When you want to add a server to Microsoft Data Protection manager to be managed (backup), it might already contain an old DPM Agent, which prevents the installation from going through. SCDPM will tell you to manually use Add/Remove Programs on each server and uninstall the old agent.
To find all servers in the environment with an old SCDPM Version run this script;
1 2 3 |
Invoke-Command -ComputerName (get-adcomputer -LDAPFilter "(&(objectCategory=computer)(operatingSystem=Windows Server*)(!serviceprincipalname=*MSClusterVirtualServer*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))" -Property name,dnshostname,description | sort-object Name).Name -Command { (Get-WmiObject -Class win32_product | where {$_.Name -like "Microsoft System Center 2012 R2 DPM Protection Agent" -and $_.Version -lt "4.2.1338.0"} ) } |
Of course, update the Version number to the latest current version of SCDPM Agent if it’s newer than 4.2.1338.0.
The get-adcomputer command will find all servers that are not disabled or Cluster Objects. So it should only give you the “real” servernames.
And here is a script that will uninstall all old versions of SCDPM Agent on all servers in the environment, so you can add the server through the SCDPM Management Console and get the new agent installed automatically.
1 2 3 4 5 6 7 8 9 10 11 |
Invoke-Command -ComputerName (get-adcomputer -LDAPFilter "(&(objectCategory=computer)(operatingSystem=Windows Server*)(!serviceprincipalname=*MSClusterVirtualServer*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))" -Property name,dnshostname,description | sort-object Name).Name -ScriptBlock { $old = (Get-WmiObject -Class win32_product | where {$_.Name -like "Microsoft System Center 2012 R2 DPM Protection Agent" -and $_.Version -lt "4.2.1338.0"}) if (($old.Version).Count -eq 1) { $version = $old.version $name = $old.Name Write-Output "Found old version of $Name $version on $env:COMPUTERNAME. Uninstalling it." ($old).Uninstall() Write-Output "Done Uninstalling" } } |
Once again, change Version (4.2.1338.0) to the correct version you want to keep. It will uninstall all older versions.
Yay! You can now add the servers to SCDPM Successfully.