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

Re: WMI, services and WinXP by Torgeir

Torgeir
Sat Feb 07 07:19:07 CST 2004

GianPiero Andreis wrote:

> 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".

Hi

If the WinXP computers are not in a domain, it can be a ForceGuest issue.

WinXP in a workgroup setting defaults to authenticate all connections coming
from "the network" as the Guest User.

More about this here:
http://groups.google.com/groups?selm=3E822EB9.C5D31E11%40hydro.com



--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Re: WMI, services and WinXP by GianPiero

GianPiero
Sat Feb 07 12:04:42 CST 2004

Thanks !

GianPiero




Re: WMI, services and WinXP by GianPiero

GianPiero
Sat Feb 07 12:15:05 CST 2004

Yes Sir,
now the code works well.

A lot of thanks

GianPiero

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> ha scritto nel
messaggio news:4024E5CB.764A0AA@hydro.com...
> GianPiero Andreis wrote:
>
> > 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".
>
> Hi
>
> If the WinXP computers are not in a domain, it can be a ForceGuest issue.
>
> WinXP in a workgroup setting defaults to authenticate all connections
coming
> from "the network" as the Guest User.
>
> More about this here:
> http://groups.google.com/groups?selm=3E822EB9.C5D31E11%40hydro.com
>
>
>
> --
> torgeir
> Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of the 1328 page
> Scripting Guide: http://www.microsoft.com/technet/scriptcenter
>
>