Page 1 of 1 1
Topic Options
#43119 - 2003-07-21 04:03 PM WMI Admin Automation
Deliverer Offline
Fresh Scripter

Registered: 2003-07-18
Posts: 23
Loc: Barbados
Hi i have a question....is it possible to use WMI to say for example enumerate the drives on a remote computer?

The function would be of the format
code:
 Function getInfo($driveName) 

I am using Kix 4.02 using a windows network that is a combination of 9x/nt/2000/xp pro

I do not have domain admin access but the person who I am writing it for will.

I have tried

code:
 $drives = GetObject("WinMgmts://$compName").ExecQuery("select Name, size from Win32_LogicalDisk") 

but this seems to only work if the $compName is set to the local computer even though on msdn here it says this should get the "default namespace on the computer myServer"

Thanks a lot for who ever can help

Dwayne
_________________________
Dwayne

Top
#43120 - 2003-07-21 04:07 PM Re: WMI Admin Automation
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
WMI can query remote computer if the user has the appropriate permissions, by default domain admin. However, you can use fnWMIAuthentication() - Authenticates against a local or remote WMI provider to authenticate with different credentials.

You cannot remotely query Windows 9x computers unless you correectly configure a couple of components manually that will ultimately allow remote admin access to Windows 9x computers
_________________________
There are two types of vessels, submarines and targets.

Top
#43121 - 2003-07-21 04:11 PM Re: WMI Admin Automation
Deliverer Offline
Fresh Scripter

Registered: 2003-07-18
Posts: 23
Loc: Barbados
thanx I will have to let him test it with his admin rights and see if it works or use your function either way i will post some feedback later in the day/week
_________________________
Dwayne

Top
#43122 - 2003-07-21 04:21 PM Re: WMI Admin Automation
Deliverer Offline
Fresh Scripter

Registered: 2003-07-18
Posts: 23
Loc: Barbados
I let the domain admin try it and it seems to work ok so thanx neway Jens! [Smile]
_________________________
Dwayne

Top
#43123 - 2003-07-21 04:23 PM Re: WMI Admin Automation
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
For Windows 9x clients please see: How to configure Win9x for remote WMI connections
Top
#43124 - 2003-07-21 05:12 PM Re: WMI Admin Automation
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
see the UDF, DriveEnum() and DriveProp()

but it uses WSH instead
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#43125 - 2003-07-21 05:47 PM Re: WMI Admin Automation
Deliverer Offline
Fresh Scripter

Registered: 2003-07-18
Posts: 23
Loc: Barbados
thanx for all of the replies...I checked with the Admin but he told me he only needs it for the Nt/2000 servers so i won't have to do any installs on win9x thankfully
_________________________
Dwayne

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 271 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.053 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org