Skip to content

Instantly share code, notes, and snippets.

@bcdady
Created June 27, 2016 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcdady/96a4020bcf8b064bd7f382b89476ec65 to your computer and use it in GitHub Desktop.
Save bcdady/96a4020bcf8b064bd7f382b89476ec65 to your computer and use it in GitHub Desktop.
If you'd like to set this properly in the Registry via cmd/bat, or PowerShell, be sure to specify the key is in HLKM, not HKCU.
Get-Item HKCU:\Software\Microsoft\ServerManager may succeed, but the other 2 fail if aimed at the Current_User hive.
Presuming what you'd like is for ServerManager to NOT auto open at logon, the following 1-liner (PowerShell) will test if the registry value should be updated, and then update the proper key/value:
if ((Get-ItemProperty -Path HKLM:\Software\Microsoft\ServerManager -Name DoNotOpenServerManagerAtLogon).DoNotOpenServerManagerAtLogon -ne 0) { New-ItemProperty -Path HKLM:\Software\Microsoft\ServerManager -Name DoNotOpenServerManagerAtLogon -PropertyType DWORD -Value '0x1' –Force }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment