M
Mark
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=impersonate}!//xxxxxxxxxxxx/root/cimv2").ExecQuery("SELECT
* from Win32_Account")
set IPConfigSet =
GetObject("winmgmts:{impersonationLevel=delegate,authority=ntlmdomain:xxxx}//xxxxxxxxxxxx/root/cimv2").ExecQuery("SELECT
* from Win32_Account")
Any help would be greatly appreciated
Mark
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=impersonate}!//xxxxxxxxxxxx/root/cimv2").ExecQuery("SELECT
* from Win32_Account")
set IPConfigSet =
GetObject("winmgmts:{impersonationLevel=delegate,authority=ntlmdomain:xxxx}//xxxxxxxxxxxx/root/cimv2").ExecQuery("SELECT
* from Win32_Account")
Any help would be greatly appreciated
Mark