Upgrade your Specops Deployment servers using Powershell

Upgrade your Specops Deployment servers using Powershell

A few weeks ago, I visited a customer with a large Specops Deploy environment: about 60 sites and one deployment server on each site.

Instead of upgrading from the Specops Deploy GUI, I used two PowerShell scripts and the awesome Specops Deploy cmdlets.

First, I wanted to get all the Deployment Servers in the domain. A good way of doing that is querying AD for all machines with a Service Connection Point called Specops Deploy Deployment Server, and writing those host names to a text file.

Upgrade your SD servers using Powershell - pic 1

The “collect servers” script:

$filePath = "C:\Temp\DeploymentServers.txt"
Remove-Item $filePath -ErrorAction SilentlyContinue
$serviceConnectionPoint = Get-ADObject -Filter 'ObjectClass -eq "serviceConnectionPoint" -and Name -eq "Specops Deploy Deployment Server"' 
$serviceConnectionPoint | ForEach-Object {
    $AdsiObject = [ADSI]"LDAP://$_"
    $DeploymentServerName = ($AdsiObject.PSBase.Parent).dnsHostName
    write-host -fore Green "Adding deployment server $DeploymentServerName to file"
    $DeploymentServerName | Out-File -FilePath $filePath -Append

I can use the text file with my next script: the “upgrade” script which will upgrade all servers named in the text file C:\Temp\DeploymentServers.txt.When each upgrade is complete, it will also remove the Multicast configuration from Windows Deployment Services. If you don’t see yourself as a network infrastructure guru, and also plan to deploy over 50 machines at the same time, you might want to remove Multicast from WDS. This will do it for you.

The “upgrade” script:

Import-Module SpecopsDeploy;
Get-Content -Path C:\Temp\DeploymentServers.txt | foreach {
    Write-Host ""
    Write-Host "Upgrading Server $_ ..." ;
        Upgrade-SDDeploymentServer -ServerName $_
        Remove-SDMulticastStream $_ 
        $_ | out-file -append -filepath 'c:\SuccessfulUpgrades.txt'
        Write-Host -fore Green "Successfully upgraded $_"
        Write-Host -fore Red "Failed to upgrade $_"
        $_ | out-file -append -filepath 'c:\FailedUpgrades.txt'

I hope this will help our customers with large Specops Deploy environments.

Happy Deployment!

(Last updated on August 2, 2018)

Tags: ,

Written by

Mikael Ingelin

Product Specialist, Specops Software

More Articles
Back to Blog

Related Articles

  • Failing Specops Deploy package

    A customer had a problem with a App Deploy package that’s not working. He says it works fine when executing manually with runas administrator, but it’s not working when using Specops Deploy, on a computer target. I asked him for the package to have a look at it. He was trying to execute a script…

    Read More