I just updated our System Center Virtual Machine Manager 2012 R2 Environment to Update Release 7. SCVMM would then report that the SCVMM Managed Computers has an Out-of-Date Agent which need to be upgraded.
It’s possible to do it manually by right clicking on each server and choose “Update Agent” or use this short powershell script to do it on all machines at the same time.
# Change name to the RunAs Admin Account specified in SCVMM
$SCVMMADMIN = 'SCVMM_Admin'
$credential = Get-SCRunAsAccount -Name "$SCVMMADMIN"
Get-SCVMMManagedComputer | where VersionState -ne UpToDate | Update-SCVMMManagedComputer -Credential $credential -RunAsynchronously
It will Update the Agent on all Managed Servers for you (no restart needed in my case).
One thought on “Update SCVMM Agent with Powershell”
I usually run a scan, especially if you have infrastructure servers, as the don´t show “Update Needed” as the Hyper-V hosts does.
Get-SCVMMManagedComputer | ? RoleString -eq -Value Infrastructure | Read-SCVMMManagedComputer