How to edit Registry Keys use PowerShell

How to Get, Edit, Create and Delete Registry Keys with PowerShell

get-psdrive
cd HKLM:\
set-location -path HKLM:\SOFTWARE\Microsoft\WebManagement\Server
Get-childitem
 

Get-item -path HKLM:\SOFTWARE\Microsoft\WebManagement\Server

Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WebManagement\Server" -Name "EnableRemoteManagement" -Value ”1”

image

 

Getting Registry Key Values Remotely 

Invoke-Command -ComputerName dc01 -ScriptBlock { Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\WebManagement\Server' -Name EnableRemoteManagement}
 

Editing the Registry Remotely

Enter-PSSession dc02 -Credential afd\gazh

Searching in the Registry

get-childitem -path hkcu:\ -recurse -ErrorAction SilentlyContinue | Where-Object {$_.Name -like "*Network*"}
 

Editing the Registry

Set-Itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' -Name 'VMware User Process' -value 'C:\Program Files\VMware\VMware Tools\vmtoolsd.exe'
 
New-Item –Path "HKCU:\dummy" –Name NetwrixKey
New-ItemProperty -Path "HKCU:\dummy\NetwrixKey" -Name "NetwrixParam" -Value ”NetwrixValue”  -PropertyType "String"
Remove-ItemProperty -Path "HKCU:\dummy\NetwrixKey" -Name "NetwrixParam"
Remove-Item -Path "HKCU:\dummy\NetwrixKey" -Recurse
Rename-ItemProperty -Path "HKCU:\dummy\NetwrixKey" -Name "NetwrixParam" -NewName "NetwrixNewParam"
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章