Page 1 of 1 1
Topic Options
#191806 - 2009-01-15 07:30 PM Problems with WMIService()
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Not that I think the UDF is broken, but it is returning an error code of 2 (WMI not available), yet I know that it is running on the server that I am attempting to connect to.

Here is the code that I am using, any troubleshooting tips you can provide I would appreciate.

 Code:
$nul = WMIService("My Service Name","Stop",,"\\server")

;  Wait for the service to stop

While WMIService("My Service Name","Query",,"\\server") <> "Stopped"

Loop

_________________________
Today is the tomorrow you worried about yesterday.

Top
#191810 - 2009-01-15 07:58 PM Re: Problems with WMIService() [Re: Gargoyle]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11616
Loc: CA
Did you try this UDF?
WMIConfirm() - Confirm access and version of WMI

Top
#191813 - 2009-01-15 09:34 PM Re: Problems with WMIService() [Re: NTDOC]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Hey Thanks Doc. Found the problem. Do not put the "\\" in the server name.
_________________________
Today is the tomorrow you worried about yesterday.

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 294 anonymous users online.
Newest Members
MacduMela, karimKix, NicoK, Kelly001, MichaelK72
17776 Registered Users

Generated in 0.054 seconds in which 0.021 seconds were spent on a total of 13 queries. Zlib compression enabled.

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