Hi all, this script will be helpful if we enter into a situation where we need to reprovision multiple agents at a time due to Orion certificate issue.
Below is the script format to use and call the attached script to reprovision multiple agents at a time.
***************************************************************************************************************
$RemoteComputers= get-content “D:\xx\xx\xx(path to the text file where list of servers to run”
ForEach ($RemoteComputer in $RemoteComputers)
{
If (Test-WSMan -ComputerName $RemoteComputer)
{
Invoke-Command -ComputerName $RemoteComputer -FilePath
\xx\(path to .ps1 file that needs to be executed) }
}