Re: Remote WMI problem...Permission Denied:'getobject'

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



Relevant Pages

  • Re: Need Script to ferret out machines not in domain
    ... chose to name the workgroup the same name as the domain. ... > So now I need to find a way to figure out what all machines are still in ... you run a logon script that provides them some service such are mapping ... I would update the logon script to make things progressively ...
    (microsoft.public.windows.server.scripting)
  • Re: Startup Script To Map Printer depending on OU
    ... printer that maps it to the local machine when a user logs on. ... Pete ... > Can you post the script that you are using... ...
    (microsoft.public.windows.server.setup)
  • Re: AD user home folder creation
    ... I had all of this including the permissions but was wanting a "cleaner way" ... As far as the code to create the folder: ... "Pete Gomersall" wrote: ... the script writing to AD doesn't invoke creating the users home ...
    (microsoft.public.windows.server.scripting)
  • Re: [opensuse] mp3info help
    ... I look after a community radio station and a presenter is modifying the ... I want to run this script from cron before and after his show and send ... Hi Pete, ... doesn't support ogg. ...
    (SuSE)
  • remote access denied
    ... I'm trying to build a small script for remote process supervision. ... I have three XP pro machines ... in a workgroup. ...
    (microsoft.public.scripting.wsh)