Created
November 1, 2022 15:02
-
-
Save pstakuu/478b2cf70b951cb4221aa0b772bd0e9f to your computer and use it in GitHub Desktop.
HKCU changes as admin - specifically this one for hiding ads in Outlook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $loggedonUser = get-wmiobject -Class win32_computersystem |select username | |
| $objuser = new-object System.Security.Principal.NTAccount($loggedonUser.username) | |
| $userdata = $objuser.Translate([System.Security.Principal.SecurityIdentifier]) | |
| Set-ItemProperty "registry::hkey_users\$($userdata.value)\Software\Microsoft\Office\16.0\Common\TargetedMessagingService\MessageMetadata\*MsgId:BizBar" -Name AppIdOnAction -Value 6 | |
| Set-ItemProperty "registry::hkey_users\$($userdata.value)\Software\Microsoft\Office\16.0\Common\TargetedMessagingService\MessageMetadata\*MsgId:BizBar" -Name SetUserAction -Value 2 | |
| #current user changes as admin: https://stackoverflow.com/questions/66066661/how-to-edit-hkcu-values-with-powershell#:~:text=When%20running%20an%20elevated%20PowerShell%2C%20the%20user%20specific,SID%3E....%20For%20example%3A%20Get-ItemProperty%20-Path%20%22registry%3A%3Ahkey_users%24%20%28%24strSID.Value%29SoftwarePoliciesMicrosoftWindowsControl%20PanelDesktop%22 | |
| #reg settings: https://community.spiceworks.com/topic/2276029-outlook-displays-take-your-outlook-anywhere-how-do-i-stop-these-messages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment