New
#1
Can I force a user to log off automatically through a logon script?
Hi there
I've trying to invoke a fix on the fly and have got a mixed windows workstation environment on my network. For particular reasons, I don't want my windows XP users to use a Windows 7 machine and equally I don't want a Windows 7 user to use a Windows XP machine. Silly I know but there you go.
I've set up a couple of WMI filters that determine the machine type and have used the following script to ensure that each user type is logged off and the PC restarted.
Option Explicit
Dim objShell
MsgBox"The detected logon method is not supported " & chr(13) & chr(13) & "Please revert to using your own computer." & chr(13) & chr(13) & "This computer will now restart" & chr(13) & chr(13),0,"Invalid Logon Detected."
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "C:\WINDOWS\system32\shutdown.exe -r -f -t 0"
For the Windows XP users on Windows 7 machines it works fine, however when a Windows 7 user logs into a Windows XP machine, it displays the message but won't do the restart bit on the Windows 7 machines.
Do I need to create some elevated permissions for my windows 7 machines.