Func _ccdown($strComputer) $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & $strComputer & "\root\cimv2") If @error Then MsgBox(64, 'Fehler' , 'Der Computer konnte nicht heruntergefahren werden.') Exit EndIf $colOperatingSystems = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For $objOperatingSystem in $colOperatingSystems $objOperatingSystem.Win32Shutdown(8) Next EndFunc Func _ccboot($strComputer) $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & $strComputer & "\root\cimv2") If @error Then MsgBox(64, 'Fehler' , 'Der Computer konnte nicht neu gestartet werden.') Exit EndIf $colOperatingSystems = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For $objOperatingSystem in $colOperatingSystems $objOperatingSystem.Win32Shutdown(2) Next EndFunc Func _cclogoff($strComputer) $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & $strComputer & "\root\cimv2") If @error Then MsgBox(64, 'Fehler' , 'Der Computer konnte nicht abgemeldet werden.') Exit EndIf $colOperatingSystems = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For $objOperatingSystem in $colOperatingSystems $objOperatingSystem.Win32Shutdown(0) Next EndFunc