473,396 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Need basic help authenticating remote wmi call from an asp webpage

Hi all,
I am attempting to create a web-page that will check several servers and
verify that the local admin account has been renamed properly. I've written
a .vbs (command file) to do it - I have the necessary rights on each
server - and it works just fine (portion shown below)

My problem is converting it to an asp web page. When I try, I always get a
security failure. I've checked and the page is running under a domain id
with admin rights to the servers. I am assuming its something I just can't
find the answer to, about the way ASP handles security impersonation. Can
someone point me to where I need to look?

Original .vbs code (which works)

Set WmiObjSet = GetObject("winmgmts:\\" & strComputer)
Set colItems = WmiObjSet.ExecQuery ("Select * from Win32_Account)
Code in test.asp which fails with: Permission Denied: 'GetObject'

Response.Write Request.ServerVariables("LOGON_USER")
set IPConfigSet = GetObject("winmgmts://xxxxxxxxxxxx").ExecQuery("SELECT
* from Win32_Account")
Based on some examples on MSDN, I have also tried (with no luck):

set IPConfigSet =
GetObject("winmgmts:{impersonationLevel=impersonat e}!//xxxxxxxxxxxx/root/cimv2").ExecQuery("SELECT
* from Win32_Account")

set IPConfigSet =
GetObject("winmgmts:{impersonationLevel=delegate,a uthority=ntlmdomain:xxxx}//xxxxxxxxxxxx/root/cimv2").ExecQuery("SELECT
* from Win32_Account")
Any help would be greatly appreciated
Mark

Nov 1 '07 #1
1 2241
"Mark" <ma*********@verizon.netwrote in message
news:8F**********************************@microsof t.com...
Hi all,
I am attempting to create a web-page that will check several servers and
verify that the local admin account has been renamed properly. I've
written
a .vbs (command file) to do it - I have the necessary rights on each
server - and it works just fine (portion shown below)

My problem is converting it to an asp web page. When I try, I always get a
security failure. I've checked and the page is running under a domain id
with admin rights to the servers. I am assuming its something I just can't
find the answer to, about the way ASP handles security impersonation. Can
someone point me to where I need to look?

Original .vbs code (which works)

Set WmiObjSet = GetObject("winmgmts:\\" & strComputer)
Set colItems = WmiObjSet.ExecQuery ("Select * from Win32_Account)
Code in test.asp which fails with: Permission Denied:
'GetObject'
>
Response.Write Request.ServerVariables("LOGON_USER")
set IPConfigSet =
GetObject("winmgmts://xxxxxxxxxxxx").ExecQuery("SELECT
* from Win32_Account")
Based on some examples on MSDN, I have also tried (with no luck):

set IPConfigSet =
GetObject("winmgmts:{impersonationLevel=impersonat e}!//xxxxxxxxxxxx/root/cim
v2").ExecQuery("SELECT
* from Win32_Account")

set IPConfigSet =
GetObject("winmgmts:{impersonationLevel=delegate,a uthority=ntlmdomain:xxxx}/
/xxxxxxxxxxxx/root/cimv2").ExecQuery("SELECT
* from Win32_Account")
Any help would be greatly appreciated
You say "I've checked and the page is running under a domain id with admin
rights to the servers". How have you done that?

What happens if you turn off anonymous access and turn on Windows
intergrated then visit the page using the same logon credentials you used in
script testing?

--
Anthony Jones - MVP ASP/ASP.NET
Nov 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ryan Kaskel | last post by:
Is it possible to get the source of a remote webpage (just the straight HTML) without anything too complicated (like COM, I just want to write a simple script if possible) and write it to a file?...
2
by: Deepson Thomas | last post by:
HI, i have a question abt dot net. Let me tell you the sceneraio...i have a asp.net page written in C#. there is a textbox and a button in the page thatz it. the functionality i want is that...
2
by: Eli | last post by:
Hi gurus, My question is about exchanging data on a basic HTML page between a JavaScript piece of code and a Java client-side <APPLET> residing on the same webpage. To demonstrate the idea of...
14
by: jj | last post by:
Is it possible to call a remote php script from within Access? I'm thinking something like: DoCMD... http://www.domain.com/scripts/dataquery.php DoCmd.OpenQuery "update_data", acNormal, acEdit...
4
by: russzee | last post by:
Hi, I want to populate my client's webpage (Remote Server) automatically through my Server and Database by having him just paste a javascript on his webpage. I have read up about Microsoft...
0
by: trend | last post by:
Does WSE really care (when authenticating via PKI) what type of webserver it authenticates to? Example: I have 10client programs that I handed out to my friends.. with each of these client...
6
by: Alejandro Dubrovsky | last post by:
I see from googling around that this is a popular topic, but I haven't seen anyone saying "ah, yes, that works", so here it goes. How does one connect through a proxy which requires basic...
3
by: nandan | last post by:
Yes. My client has a proxy server. That much i know. In my application I make two kinds of calls that are affected by the proxy server I finally got the webservice call working. But my...
0
by: gengyue | last post by:
Hi, Refer to my previous post "Calling web serive from JSP", I found an article on msfn2.microsoft.com. "Using the WebService behavior, it is not possible to call a remote method directly on a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.