Hi Experts
On few of my servers, i need to add registry entries remotely. Please guide me.
i have a registry entry by name exclude under (HKEY_LOCALMACHINE\SOFTWARE\MYAPPLICATION\CONFIG) and i need to add few entries like *.xyz , C:\xyz in the exclude registry.
I am trying to write powershell script experts help me
$Servers = Get-Content “C:\Servers.txt”
$TotalServersCount = ($Servers).Count
$PerCentageCounter = 1
Foreach ($Server IN $Servers) {
$PerCentCompleted = [System.Math]::Round(($PerCentageCounter/$TotalServersCount*100),0)
Write-Progress -Activity "Processing Server [$PerCentageCounter] [$Server]" -CurrentOperation "Checking Connectivity to the Server"
# Check Ping Connection to the Server
if (! (Test-Connection -ComputerName $Server -Count 2 -ErrorAction SilentlyContinue -Quiet)) {
Write-Warning "Ping check failed for $Server, Skipping Server"
Write-Progress -Activity "Ping check failed for $Server, Skipping Server" -Status "$PerCentCompleted% Complete:" -PercentComplete $PerCentCompleted
Start-Sleep -Seconds 5
$PerCentageCounter++
Continue
}
Write-Progress -Activity "Processing $Server Server" -CurrentOperation "Updating Registry Value"
# Adding software exclusion
REG ADD "\\$Server\HKEY_LOCALMACHINE\SOFTWARE\MYAPPLICATION\CONFIG"