DantanaSwat
IS-IT--Management
I have this little diddy
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
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"
Set colOperatingSystems = objWMIService.ExecQuery ("SELECT * FROM Win32_OperatingSystem"
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Win32Shutdown(4)
Next
end sub
Problem is this. When I set the security to impersonate {impersonationlevel=impersonate,(shutdown)}...it craps out..when there so security...only admins can logoff
any ideas where I could look?
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
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"
Set colOperatingSystems = objWMIService.ExecQuery ("SELECT * FROM Win32_OperatingSystem"
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Win32Shutdown(4)
Next
end sub
Problem is this. When I set the security to impersonate {impersonationlevel=impersonate,(shutdown)}...it craps out..when there so security...only admins can logoff
any ideas where I could look?