Registry Manipulation Use Cases

How to Modify the Powershell Execution Policy from Registry?

Querying Execution Policy
Get-ItemProperty -path HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell
Modifying Execution Policy
Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell -Name ExecutionPolicy -Value remotesigned

How to Disable the Server manager from Loading at startup?

New-ItemProperty -Path HKCU:\Software\Microsoft\ServerManager -Name DoNotOpenServerManagerAtLogon -PropertyType DWORD -Value "0x1" –Force

How to Enable the Remote desktop settings from Registry? (To Allow Remote connections to the computer)

Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" –Value 0

How To Pull Software Inventory from Registry?

$path1 = ‘HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*’
$path2 = ‘HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*’
$path3 = ‘HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*’
$path4 = ‘HKCU:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*’
Get-ItemProperty -Path $path1, $path2, $path3, $path4 |
Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |ConvertTo-Html -Head "Software Invenntory Report" | Out-File C:\Users\$ENV:Username\Desktop\softwareInventory.htm
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s