Recently I had to make a list of all the build in a XenApp site. A syou might have already noticed, in large enterprise, getting  the same OS version / build become a task hard to achieve since Windows 2016 / Windows 10 era. With the monthly updates and patches, released tend to become difficult to maintain at the same level in time.

This task needed to be automated to be able to have this information in realtime and able to build report of different Windows 2016 build splits among all the XenApp servers.

# Use the FQDN of your XenApp Delivery Controller for $XDDC , is XenDesktop you need to change SessionSupport to be equal to SingleSession.
# OS.csv will be created with build informations.
 
Add-PSSnapin citrix*
 
$XDDC = "DeliveryController FQDN"
$exportCSV = ".\OS.csv"
 
Remove-Item $exportCSV -ErrorAction SilentlyContinue 
 
foreach ($list in (Get-BrokerMachine  -AdminAddress $XDDC -Filter "((SessionSupport -eq `"MultiSession`"))" -Skip 0 | Select-Object DNSName)) {
 
 
 if((Test-Connection -Cn $list.DNSName -Protocol DCOM -BufferSize 16 -Count 1 -ea 0 -quiet ))
 
    {  
 
        $s = New-PSSession -ComputerName $list.DNSName
            $ver = Invoke-Command -Session $s -ScriptBlock {Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"}
        $s | Remove-PSSession | out-null
            $ver | select PSComputerName, ProductName ,ReleaseId, CurrentVersion, CurrentBuild, UBR | export-csv -Path $exportCSV -NoTypeInformation -Append 
            $ver | select PSComputerName, ProductName ,ReleaseId, CurrentVersion, CurrentBuild, UBR | Write-Host
    } 
 
    #Write-Host $list.DNSName
 
}

Some Excel magic

How come I do have some many different Windows 2016 build in the same delivery group ? ^^

Hope this helps !

Thanks to Renaud Devers for the help 🙂

0 204