+ Post New Thread
Results 1 to 7 of 7
Mac Thread, Logoff Windows to Bootpicker in Technical; We have bootcamped our new iMacs. Now we need to have XP restarting when the user selects logoff. I have ...
  1. #1

    Join Date
    Jun 2008
    Posts
    142
    Thank Post
    19
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Logoff Windows to Bootpicker

    We have bootcamped our new iMacs.
    Now we need to have XP restarting when the user selects logoff.

    I have followed the following directions
    Configuring Windows to reboot on logout

    Fundamental to the utility of BootPicker is getting a machine to always return to the BootPicker screen when a user is finished using Mac OS X or Windows. Many labs maintain a policy that users must log off of the computer before leaving to protect their data and identity. By enforcing this type of policy, lab managers can leverage this opportunity to reboot Windows to Mac OS X.

    To reboot Windows at log off time, do the following:

    1. Create a plain text file named "logoff-restart.cmd" with the contents "shutdown -r -f -t 0". Save it to the Desktop (for now).
    2. Choose "Run" from the Start menu, type "gpedit.msc" and hit return.
    3. Navigate to User Configuration > Windows Settings > Scripts
    4. Double-click on the "Logoff" item in the pane on the right.
    5. Click the "Add..." button, then click the "Browse" button.
    6. Drag the logoff-restart.cmd file into the Browse window. That should copy the file to C:\WINDOWS\system32\Group Policy\User\Scripts\Logoff.
    7. Select the logoff-restart file in the browse window and click "Open". Click "OK" to dismiss the "Add a script" window.
    8. Click "Apply", then click "OK". Log off to test that the script applied.

    The script works fine if i run it manually. However, when i log a user off it just flashes up 'Running logoff scripts' and doesn't reboot, it just logs off as usual.

    Any ideas? I've also gave "Force shutdown from a remote system" access to 'INTERACTIVE' as suggested in another forum.

    So, the script works fine, the local GPO doesn't want to run it despite it apparantly trying...

  2. #2

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,238
    Thank Post
    239
    Thanked 1,564 Times in 1,248 Posts
    Rep Power
    339
    Why not remove the logoff option altogther using GPOs?

  3. #3

    Join Date
    Jun 2008
    Posts
    142
    Thank Post
    19
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by Michael View Post
    Why not remove the logoff option altogther using GPOs?

    And then only leave a restart button?

    It's a possible solution, especially if you can just leave the restart button there.

  4. #4

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,238
    Thank Post
    239
    Thanked 1,564 Times in 1,248 Posts
    Rep Power
    339
    Well thinking about it, you can remove both Logoff and Shutdown from the Start Menu using GPOs.

    Logon to XP, right click the desktop and choose New > Shortcut

    Enter this path: C:\WINDOWS\system32\shutdown.exe

    Click Next > and the name the shortcut Restart then click Finish

    Right click the shortcut and choose Properties

    The target will read: C:\WINDOWS\system32\shutdown.exe

    Update it so it reads: C:\WINDOWS\system32\shutdown.exe -r -t 01

    If you like, you can also give it a nicer icon, by clicking Change Icon. Now if you double click this shortcut, Windows will automatically restart for you. Hope this helps.

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,757
    Thank Post
    825
    Thanked 1,662 Times in 1,447 Posts
    Blog Entries
    11
    Rep Power
    441
    You can remove the logoff option using group policy but then you will need shutdown and on that menu is a logoff option.

    What you could do is remove logoff and shutdown and place this VBS script in netlogon and place a shortcut in the start menu. Just a note if you are in the staff group it will log you off instead.

    On error resume next

    Dim objNetwork '[Object] WScript.Network object
    Dim check, sComputer, strlogoffuser, objUser

    Set objNetwork = CreateObject("Wscript.Network")
    sComputer = objNetwork.computername

    Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//" & sComputer & "/root/cimv2").ExecQuery("select * from Win32_OperatingSystem"_
    & " where Primary=true")

    ':::::::::::::::::::::::::::::::::::::::::::::::
    '::: Use LDAP to find out account details :::
    ':::::::::::::::::::::::::::::::::::::::::::::::
    Set objSystemInfo = CreateObject ("AdSystemInfo")
    Err.Clear
    Set objUser = GetObject ("LDAP://" & objSystemInfo.UserName)
    If Err.Number <> 0 Then
    MsgBox Err.Number & vbTab & Err.Description
    End If

    '::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::
    ':: DO A USER OR COMPUTER NAME CHECK TO DETERMINE LOGOFF STATE ::
    '::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::

    strlogoffuser = "CN=Staff"
    If IsMember (strlogoffuser) Then call logoffonly
    strlogoffuser = "CN=AdminDriveSet"
    If IsMember (strlogoffuser) Then call logoffonly

    check = UCASE(sComputer)
    if check ="HC-EREG-ROOMA2" then call logoffonly
    if check ="HC-NETMANLAP" then call logoffonly

    ':::::::::::::::::::::
    ':: Reboot Computer ::
    ':::::::::::::::::::::
    'Call WMI query to collect parameters for reboot action
    Const EWX_LOGOFF = 0
    Const EWX_SHUTDOWN = 1
    Const EWX_REBOOT = 2
    Const EWX_FORCE = 4
    Const EWX_POWEROFF = 8

    For each OpSys in OpSysSet
    opSys.win32shutdown EWX_REBOOT + EWX_FORCE
    Next

    Wscript.Quit

    '::::::::::::::::::::
    '::: Log off Only :::
    '::::::::::::::::::::
    sub logoffonly
    'Call WMI query to collect parameters for reboot action
    Const EWX_LOGOFF = 0
    Const EWX_SHUTDOWN = 1
    Const EWX_REBOOT = 2
    Const EWX_FORCE = 4
    Const EWX_POWEROFF = 8

    For each OpSys in OpSysSet
    opSys.win32shutdown EWX_LOGOFF + EWX_FORCE
    Next

    Wscript.Quit
    end sub

    '::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::
    '::: CHECK WHETHER USER IS A MEMBER OF A CERTAIN GROUP :::
    '::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::
    Function IsMember (strGroup)

    Dim objGroup
    IsMember = FALSE
    For Each objGroup In objUser.Groups
    strThisGroup = Replace (objGroup.Name, "CN=\", "")
    If strThisGroup = strGroup Then

    IsMember = TRUE
    Exit For
    End If
    Next
    End Function

  6. #6

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123
    Could it be that because this machine is a member of the domain (is it??) that the domain policies are kicking out the local machine policies?

    Not sure if there's anything about XP running on a Mac which you can pick up in a script (but you could name them things like MAC01 etc or set an environment variable) but if you can identify it then you could just add something to your standard logoff script which checks to see if the machine is a Mac and, if so, runs the shutdown command you already have.

  7. #7

    Join Date
    Jun 2008
    Posts
    142
    Thank Post
    19
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks all, i'll look into each of the solutions above.

    @srochford
    They are part of the domain, yes. I've searched for GPOs that might be running and are stopping this script, however, the machine is in a new OU and only has a domain policy which doesn't have anything running and the users that i'm testing with don't seem to have anything that would stop, either.

    We don't use logoff scripts, unless the previous technician has them hidden away somewhere, somehow (which wouldn't be the first time!).

SHARE:
+ Post New Thread

Similar Threads

  1. Remove files in the recycle Bin at logoff
    By timbo343 in forum Windows
    Replies: 5
    Last Post: 14th November 2008, 06:14 PM
  2. Logoff Script problems and GPO
    By placky in forum Windows
    Replies: 3
    Last Post: 27th March 2008, 06:03 PM
  3. Delete Profile on LogOff
    By roland in forum How do you do....it?
    Replies: 11
    Last Post: 20th September 2007, 09:43 PM
  4. Auto logoff by GPO?
    By contink in forum How do you do....it?
    Replies: 8
    Last Post: 31st March 2007, 10:12 PM
  5. CC3 Workstations seem to hang on logoff
    By Mintsoft in forum Windows
    Replies: 3
    Last Post: 27th February 2006, 03:33 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •