DantanaSwat
IS-IT--Management
calling this logoff sub and its failing cos its not getting the strUser and strComputer from the rest of the script
sub logoff(noFile)
If objFSO.FileExists(noFile) Then
set objFile = objFSO.OpenTextFile(noFile,8)
else objFSO.CreateTextFile(noFile)
set objFile = objFSO.OpenTextFile(noFile, 8)
end If
objFile.WriteLine(strUser & "," & strComputer & "No"
objFile.Close
Set objWMIService = GetObject("winmgmts: {(4)}" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
Set colOperatingSystems = objWMIService.ExecQuery ("SELECT * FROM Win32_OperatingSystem"
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Win32Shutdown(4)
Next
end sub
sub logoff(noFile)
If objFSO.FileExists(noFile) Then
set objFile = objFSO.OpenTextFile(noFile,8)
else objFSO.CreateTextFile(noFile)
set objFile = objFSO.OpenTextFile(noFile, 8)
end If
objFile.WriteLine(strUser & "," & strComputer & "No"
objFile.Close
Set objWMIService = GetObject("winmgmts: {(4)}" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
Set colOperatingSystems = objWMIService.ExecQuery ("SELECT * FROM Win32_OperatingSystem"
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Win32Shutdown(4)
Next
end sub