Power Button - Start Menu

Page 3 of 5 FirstFirst 12345 LastLast

  1. Posts : 72,049
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #20

    mandinga09 said:
    Hi All,

    Is there a way to push the power button changes to multiple PCs? By that I mean, can I set the power button to "Log Off" on multiple machines with a script? We prefer to log off in our domain instead of shutdown, and it would be nice to set the 'Shut Down' button to 'Log off' on all my PCs (and all my users) in the domain without visiting each machine...

    Thanks guys,

    M
    Hello M, and welcome to Seven Forums.

    I don't use a domain, but I would think that using OPTION FIVE to set your domain policy would have it enforced on all systems when they logged in to the domain. Hopefully someone with more domain experience will post to verify.
    Last edited by Brink; 23 Mar 2012 at 12:41. Reason: added quote
      My Computer


  2. Posts : 3
    Windows 7 Ent x64 SP1 (7601)
       #21

    Thanks for the quick response Brink! Unfortunately I do not have access to the GPOs for the domain (and the folks who do are clueless...) so I am forced to accomplish simple Group policy tasks with complicated scripts and deployments via SCCM. Thanks again, lets hope someone knows a way to push this fix with a script.
      My Computer


  3. Posts : 2,913
    Windows 7 Ultimate x64 SP1
       #22

    If you aren't a domain admin, you won't be able to push out policy. You could write logon scripts, but unless you can assign logon scripts to individuals in AD, they would be useless. I'm not familiar with SCCM, as we don't use it on our domain. Exactly what does it allow you, as a non-domain admin, to do in the domain?
      My Computer


  4. Posts : 3
    Windows 7 Ent x64 SP1 (7601)
       #23

    Hi keg,

    I should clarify: I am a domain admin, just not with access to the DC or GPOs. We have a tiered access model, so only a few people have access to the DCs and I am not one of them. However I have access to pretty much everything else.

    SCCM is a tool that allows you to push software and run reports on domain PCs from a central console. We would be dead without it; its a great tool. We use it to install software on up to 1500 PCs at once - push security updates to software, remove unapproved software, report on system hardware, deploy reg hacks... Typically when I need to deploy a fix that I can't get the GPO guys to make, I build a script and deploy it via SCCM, which will ensure 100% compliance every time. This solution is as reliable as a GPO, but more complex for sure.

    M
      My Computer


  5. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #24

    Here is some code to deploy that should accomplish the task for you. It parses all user profiles on the computer, loads their HKCU hives and then sets the appropriate registry key.

    Note that I have just provided the code, as I am not familiar with SCCM and so you will need to incorporate it into a suitable script that can be deployed. I recommend that you test it first before deploying it on a wider scale.

    Code:
    ' ################################################
    ' Start of Routine
    ' ################################################
    Option Explicit
    Const ForAppending = 8
    Const HKLM = &H80000002
    ' ################################################ 
    ' HKCU reference and value to be used
    ' ################################################ 
    Const sDwordUserKey = "\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
    Const sDwordUserKeyValueName = "Start_PowerButtonAction"
    Const sDwordUserKeyValue = "1"
    ' ################################################
    ' Main
    ' ################################################
    Dim oReg, oFSO, oFile, oUserSubkey, aUserProfiles, oShell
    Dim sProfileLCase, sRegExe, sRegLoad, sRegUnload, sHiveName, sSubPath, sProfile, sValueName, sKeyPathUserProfiles, sValue, ReturnVal
    Set oReg = GetObject("winmgmts:\\.\root\default:StdRegProv")
    Set oShell = CreateObject ("WScript.Shell") 
    Set oFSO = CreateObject ("Scripting.FileSystemObject")
    ' ################################################
    ' Begin configuration of existing user profiles
    ' ################################################
    sValueName = "ProfileImagePath"
    sKeyPathUserProfiles = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
    sRegExe = "C:\Windows\system32\reg.exe"
    oReg.EnumKey HKLM, sKeyPathUserProfiles, aUserProfiles
    ' ################################################
    ' Start of users loop
    ' ################################################
    For Each oUserSubkey In aUserProfiles
    sSubPath = sKeyPathUserProfiles & "\" & oUserSubkey
    oReg.GetExpandedStringValue HKLM,sSubPath,sValueName,sValue 
    sProfile = Split(sValue, "\")
    sProfileLCase = LCase(sProfile(2)) 
    If sProfileLCase = "system32" Then
    ElseIf sProfileLCase = "localservice" Then
    ElseIf sProfileLCase = "networkservice" Then
    ElseIf sProfileLCase = "serviceprofiles" Then
    Else
    ' ################################################
    ' Load user's profile hive into a temp location
    ' ################################################
    sHiveName = "TempHive_" & sProfileLCase   
    sRegLoad = " LOAD HKLM\" & sHiveName & " """ & sValue & "\ntuser.dat"""
    oShell.Run sRegExe & sRegLoad, 0, True   
    ' ################################################
    ' Call Subroutine to change registry key
    ' ################################################
    SetConfigUserHive (sHiveName)   
    ' ################################################
    ' Unload user's profile hive
    ' ################################################
    sRegUnload = " UNLOAD HKLM\" & sHiveName
    oShell.Run sRegExe & sRegUnload, 0, True
    End If 
    Next
    ' ################################################
    ' End of users loop
    ' ################################################
    ' Default User Profile
    ' ################################################
    sHiveName = "TempHive_DefaultUser"
    sRegLoad = " LOAD HKLM\" & sHiveName & " ""C:\Documents and Settings\Default User\ntuser.dat"""
    oShell.Run sRegExe & sRegLoad, 0, True
    ' ################################################
    ' Call Subroutine to change registry key
    ' ################################################
    SetConfigUserHive (sHiveName)
    sRegUnload = " UNLOAD HKLM\" & sHiveName
    oShell.Run sRegExe & sRegUnload, 0, True
    ' ################################################
    ' Routine exit point
    ' ################################################
    WScript.Quit ()
    ' ################################################
    ' Subroutine to change registry key
    ' ################################################
    Sub SetConfigUserHive (sTempHive)
    Dim sTempHiveStringKeyPath, sTempHiveDwordKeyPath
    ' ################################################
    ' Path of registry key
    ' ################################################
    sTempHiveDwordKeyPath = sTempHive & sDwordUserKey
    ' ################################################
    ' Create Dword registry key if non-existant
    ' ################################################
    If oReg.GetDwordValue(HKLM, sTempHiveDwordKeyPath & "\", sDwordUserKeyValueName) <> 0 Then
    ReturnVal = oReg.CreateKey(HKLM, sTempHiveDwordKeyPath)
    End If
    ' ################################################  
    ' Create Dword value
    ' ################################################
    ReturnVal = oReg.SetDwordValue(HKLM, sTempHiveDwordKeyPath & "\", sDwordUserKeyValueName, sDwordUserKeyValue)
    End Sub
    ' ################################################
    ' End of Subroutine
    ' ################################################
    Acknowledgements to Nick Moseley, t3chn1ck
      My Computer


  6. Posts : 6
    Win7 Ultimate 64 w/ Latest Updates
       #25

    Thanks for such good explanations, but none of these methods work for me. I can change the setting via the power button properties and it shows logoff which is what I want. If I go to the Registry, the value is 1 (log off). The policies are set for log off.
    BUT the button still says "Shutdown!"

    Any ideas on how to fix this?
    Thanks
      My Computer


  7. Posts : 72,049
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #26

    Hello Tom, and welcome to Seven Forums.

    Does your Power button with "Shut down" in the Start Menu happen to have a little shield on it as well??

    If so, then this is normal and indicates that you have Windows Updates that need to be installed. Clicking on this "Shut down" button with the shield icon will have Windows 7 install the updates first then shut down. Afterwards your power button will return to what you had it set for.

    If this is the case, then you could use the tutorial below to turn this off by not allowing it.

    Shut Down Windows - Change "Install Updates and Shut Down" as Default

    Hope this helps, :)
    Shawn
    Last edited by Brink; 31 Aug 2012 at 12:43. Reason: typo
      My Computer


  8. Posts : 6
    Win7 Ultimate 64 w/ Latest Updates
       #27

    Shawn.

    You were RIGHT ON! I powered down and there were updates waiting. Now button is set to Log Off

    Thanks a million!
      My Computer


  9. Posts : 72,049
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #28

    You're most welcome Tom. :)
      My Computer


  10. apb
    Posts : 78
    win 7 pro x64
       #29

    How about "undock"?

    In my case (on a lenovo t61p laptop), the start menu power button arrow pulldown list includes the item "undock". The button itself currently defaults to "hibernate", presumably because in the win 7 power options dialog I have set the physical power button to hibernate the machine.

    I would like the default button value to be "undock." However, if I go to start menu properties, that is not listed as one of the options to default to. Similarly, your list of hex values to set in the registry does not include the "undock" item. Any idea how I can get that start menu button to default to "undock"? BTW, selecting undock in the pulldown menu truly does undock the machine, so it is not a no-op.

    Thanks.
      My Computer


 
Page 3 of 5 FirstFirst 12345 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:20.
Find Us