Hello Everyone,
I wrote from Italy so please be patient with my english, thanks.
I am a programmer and I would like to use WMI (great!) with Visual Basic 6.0
(or VBSCRIPT) to obtain services enumeration on a remote computer, just for
see what services are running and so on.
The code below works well with Win2K O.S., but there are no chances to use
it with WinXP; every time the error description is "Authorization denied".
I think this is a problem with WinXp access security, because the API
EnumServicesStatus (and related) like the WMI code dont' works with WinXp,
but works well with Win2K.
Same consideration with the SC.exe utility from Microsoft : impossible to
query the remote service dtabase on a WinXp O.S.
IMPORTANT
I am convinced that this is a problem related to the security and permission
because, as I say, I can't execute the code remotely
(i.e. enumerating services on a WinXp PC over the network from an another
Win2K PC...) but the code works well If I use VB directly on a WinXp PC.
Consider that the computers with WinXp O.S. are correctly registered on the
network (LAN), beacuse I can browse they shared folders with Explorer.
Can someone help me, please?
Thank You in advance for Your very very precious support.
VB 6.0 CODE [START]
'this line gets an error on a WinXP computer (remotely), but the code
works well with Win2K or WinXP (locally)
Set WMI = GetObject("WinMgmts:\\MyRemoteComputerName")
Set objs = WMI.InstancesOf("Win32_Service") 'Win32_BaseService
For Each obj In objs
Debug.Print obj.Description
Next obj
VB 6.0 CODE [END]
GianPiero