Re: Remote WMI problem...Permission Denied:'getobject'
- From: "Perry" <Perry@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 23 Oct 2005 09:27:02 -0700
Pete,
Thanks for the help. However, your script results in a slightly different
error:
Error: Access denied
Source: SWbemLocator
Line: 6
Char: 1
Perry
"Pete" wrote:
> Try using wbem to connect to remote workstations, also allows passing admin
> credentials.
>
> UserName = ""
> Password = ""
> Computer = "station100"
>
> Const CONVERSION_FACTOR = 1047586
> Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
> Set objWMIService =
> SWBemlocator.ConnectServer(Computer,"\root\CIMV2",UserName,Password)
> Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
> where DeviceID='C:'",,48)
> For Each objLogicalDisk in colItems
> FreeMegabytes = objLogicalDisk.freespace / CONVERSION_FACTOR
> Next
> WScript.Echo int(FreeMegabytes)
>
>
> Pete Forman
>
>
>
> "Perry" <Perry@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:7D530F4C-A297-4CEE-8BFD-7E6FEC0969CC@xxxxxxxxxxxxxxxx
> >I am a scripting newbie. I have this little script that I an using to take
> > baby steps into scripting:
> >
> > const CONVERSION_FACTOR = 1047586
> > Computer = "station100"
> > Set objWMIService = GetObject("winmgmts://" & Computer)
> > Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='c:'")
> > FreeMegabytes = objLogicalDisk.freespace / CONVERSION_FACTOR
> > wscript.echo "There are",int(FreeMegabytes) ,"MB of Free Space"
> >
> > The script works well locally. However it fails when trying to retrieve
> > information from any other computer in my WORKGROUP. If I specfy any other
> > computer name other that the local machine, I get "code 800A0046 Error:
> > permission denied: getobject'".
> >
> > I thought this might be a Windows XP SP2 problem so I tried all of the
> > fixes
> > in MS KB Article ID 875606. No luck. Tried adjusting rights in WMI
> > properties
> > on both computers. No luck
> >
> > I am logged on LOCALLY (same name) to both Win XP machines with
> > administrator rights. The network environment is a workgroup. I can access
> > resources back and forth from both machines. However, using Computer
> > Management Console, I can only view details locally on both machines. I
> > can
> > see nothing remotely on Computer Management console. This is true whether
> > or
> > not Windows Firewalls are enabled or disabled.
> >
> > I think there is a problem with WMI and the workgroup environment, but I
> > can't figure out what.
> >
> > Any help would be appreciated.
>
>
>
.
- References:
- Prev by Date: Re: running programs w/ command line argument?
- Next by Date: Re: running programs w/ command line argument?
- Previous by thread: Re: Remote WMI problem...Permission Denied:'getobject'
- Next by thread: Read a registryvalue from a list of IP-addresses
- Index(es):
Relevant Pages
|