Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Deleting remote registries

$
0
0

 

Hi,

I would like to delete the registry key on remote servers by using the following script, but i am unable to do so because of some errors in my script. So , i require your help to overcome the errors in my script and this script will work only for one server but i want it for multiple servers. so i require your help to do all these things.

$first = "HKLM:\Softwares\abcd32\folder32.1"
$second = "HKLM:\Softwares\abcd32\folder32.2"
$third = "HKLM:\Softwares\abcd64\Folder32.1"
$four = "HKLM:\softwares\abcd64\Folder32.2"
if($first -eq $true) and ($second -eq $true)
{
Remove-Item $first
{
write-host "$first is removed"
}
}
else
($third -eq $true) and ($four -eq $true)
{
Remove-Item $third
{Write-Host "$third is removed"
}
}


Viewing all articles
Browse latest Browse all 6937

Trending Articles