<# This will enable RDP access - remotely - so long as PSRemoting has been enabled. Otherwise, you'd likely need to do this by hand. It pulls computer names from a text file. Adjust paths as needed. #> $Computers = Get-Content "C:\_Temp\Machines.txt" $Creds = Get-Credential rsickler2@gvsd.org ForEach-Object ($Computer in $Computers) { if (Test-Connection -ComputerName $Computer -Count 1 -BufferSize 16 -ErrorAction SilentlyContinue -Quiet) { Invoke-Command –Computername $Computer –ScriptBlock { Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" –Value 0 } -Credential $Creds } else { Write-Output "$computer is offline" | Out-File "C:\_Temp\CopyErrors.txt" -Append } }