Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impersonate in Win2003 for Service Query

Status
Not open for further replies.

KeyserSoze1877

Programmer
Sep 6, 2001
95
US
I have a set of code that works fine for Window 2000 servers. However the same code against 2003 servers behave differently.
-------------------
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& ComputerName & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process")

For Each objProcess In colProcesses
ProcessInfo = objProcess.PageFileUsage
Debug.Print objProcess.Name, ProcessInfo
Next
-------------------

The query only returns the processes run with the SYSTEM account, any services running with a different account doenst get returned. The problem in the one process I need to read is run with a domain account and I cannot query it, but I can in Win2000 servers.

What do I need to change for Window2003 servers to read this?

---------------
Keyser Soze
"Vote Pedro.
 
Nevermind, turned out to be a GPO setting restricting Anon access to named Pipes. Disabled that works now.

---------------
Keyser Soze
"Vote Pedro.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top