You have an upcoming change and some new DDCs you brought online. You may be changing out to Citrix Cloud (you better be), and you may need to change the ListofDDCs to you Cloud Connector. Sometimes GPO may take a minute to reflect what you want set. You can use this to change the ListOfDDCs quickly. You can also add the ListofSSIDs if that is something that you use by adding another registry name and value in your script block. I have the Get-ItemProperty used twice to get the result of what was set before the change and to show the reflected change. I just like to doubly confirm something and make sure something hinky was not afoot.
# Script to change DDCs on a group of Citrix servers. You will need access to the remote servers and firewall access with PowerShell.
$listServers = Get-Content c:\scripts\logs\svrlist.txt
$date = Get-Date -Format MMddyyyy
$report = @()
foreach($srv in $listServers) {
$scriptBlock = {
$regName = "ListOfDDCs"
$regValue = "DDC1 DDC2 or CC1 CC2"
Get-ItemProperty -Path HKLM:\Software\Citrix\VirtualDesktopAgent
Set-ItemProperty -Path HKLM:\Software\Citrix\VirtualDesktopAgent -Name $regName -Value $regValue
Get-ItemProperty -Path HKLM:\Software\Citrix\VirtualDesktopAgent
}
$ddcUpdate = Invoke-Command -ComputerName $srv -ScriptBlock $scriptBlock
$report += $ddcUpdate
}
$report | Out-File c:\scripts\logs\$date-ddcchange-list.txt
Leave a Reply