Are you kidding? I spend about 6 hours searching this site and over a day total in the MSDN. In total I have probably made over 100 attempts to find a working solution trying different methods. However, to answer your question more specifically, when I was still trying to use WMI to shutdown the computer (I gave up when it repeatedly returned the same result as the KiXtart Shutdown function) I made some attempts to use SWbemLocator instead of the monkier. However, I ran into a serious error when calling 'Win32Shutdown(2)' which causes KiXtart to abruptly terminate. As it does appear to be a moot point, I would prefer that people don't mess with this code and post responses to it but here is the code I attempted to shutdown the computer with using WMI and SWbemLocator:code:
$objLocator=CreateObject('WbemScripting.SWbemLocator')
$objWBEM=$objLocator.ConnectServer(@Wksta,'root\CIMV2')
$objWBEM.Security_.ImpersonationLevel=3
$objShutdown=$objWBEM.ExecQuery('Select * from Win32_OperatingSystem')
For Each $objOpSys in $objShutdown
$wmirestart=$objOpSys.Win32Shutdown(2)
Next
$objShutdown=0
$objWBEM=0
$objLocator=0
Has anybody out there tried that original code to see if it will run on another network? If you are willing to help me out, please read all the posts above before doing anything.
[ 06. July 2003, 15:34: Message edited by: Gaven ]