Set OpSysSet =
GetObject("winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}\\Dell4
00").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
For Each OpSys In OpSysSet
Call OpSys.Reboot
Next
NOTE: I have hardcoded the computer name for testing
Whenever I try to run this code I get an automation error of:
-2147022986
The object exporter specified was not found
When I run this same code on a remote Win2K system it has the desired
result.
I have searched all over looking for information on this error but cannot
find anything. Can anyone tell me what I could be doing wrong here? Any help
would be appreciated!
Thanks!
JR
http://msdn.microsoft.com/library/techart/mngwmi.htm
It explains the code I used as well as provides an excellent backgrounder on
WMI in general.
JR
<kem...@my-deja.com> wrote in message news:965sr8$q80$1...@nnrp1.deja.com...
After reviewing this article:
http://msdn.microsoft.com/library/psdk/wmisdk/cimomcmd_65yr.htm
it became apparent that Win9x systems required further configuration than
simply installing the core WMI components and then running the code below.
In fact, even after configuring the system as the article outlines, I still
could not get the code to work --but I was getting different error messages
now. I started looking at some of the other registry values not listed
within the article. Values located within the following key:
HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM\CIMOM
Specifically these values:
EnableDefaultRemoting
EnableAnonConnections
By default they were set at a value of "0". I began to experiment with
setting them to "1", setting one value to "1" and the other to "0" and visa
versa. I messed around until I finally found the right configuration that
would allow the code below to work. It turned out to be:
AutostartWin9x = "1"
EnableDefaultRemoting = "0"
EnableAnonConnections = "1"
Once I had this configuration I could successfully run the code below to
reboot remote Win9x systems that have the core WMI components installed.
A couple of caveats; Windows Me systems reboot successfully but on the next
reboot the system is unstable to the point where it must be rebooted again
before it can be used. Not really a ideal situation. The Win95 OSR2 system I
tried would receive the reboot request but then hang at the "Windows is
shutting down" screen. Again, not exactly ideal. Fortunately, Windows 2000
and Windows NT 4.0 SP4+ work great. The other caveat is that I could find no
documentation anywhere on EnableDefaultRemoting --and more importantly--
EnableAnonConnections. The implication of the name itself gives rise to
security concerns.
If anyone has any information they could share on this matter I would be
greatly appreciative. There seems to be a real dearth of info on using WMI
for remote rebooting of Win9x systems.
JR
"Jerald Rawdon" <raw...@jermar.com> wrote in message
news:t8c4slj...@news.supernews.com...