Register-SCVMMManagedComputer

Reassociates a managed computer on which VMM agent software is installed with a different VMM management server.

Syntax

Register-SCVMMManagedComputer
        [-VMMManagedComputer] <VMMManagedComputer>
        -Credential <VMMCredential>
        [-RunAsynchronously]
        [-PROTipID <Guid>]
        [-JobVariable <String>]
        [<CommonParameters>]

Description

The Register-SCVMMManagedComputer cmdlet reassociates a managed computer on which Virtual Machine Manager (VMM) agent software is installed with a different VMM management server.

When you initially add a host or library server to VMM, the host or library server is associated with the VMM management server that provides the VMM database that you added the host or library server to. The VMM database might be installed in a Microsoft SQL Server database on the VMM management server itself or on a remote computer running SQL Server.

After a host or library server is added to (and therefore associated with) a VMM management server, it cannot communicate with any other VMM management server. However, you can re-associate it with a different VMM management server, as described in the following scenarios.

Scenario 1: Disaster Recovery

In this scenario, VMMServerA fails, or the VMM service running on VMMServerA fails. You might already have VMMServerB available as a backup VMM management server. If not, you can install the VMM service on VMMServerB. At this point, the VMM database might be on VMMServerB, or, if you keep the database on a separate SQL Server, you can now point VMMServerB to the VMM database on that SQL Server.

However, although you now have a functioning VMM management server (VMMServerB) and database, hosts and library servers that were managed by VMMServerA are still configured to communicate with VMMServerA. VMMServerB recognizes these managed computers, but they are in an Access Denied state. At this point, you can use Reassociate-SCVMMManagedComputer to re-associate computers that were managed by VMMServerA with VMMServerB.

Scenario 2: Re-Organizing Server Groupings

In this scenario, VMMServerA and VMMServerB are two existing VMM management servers that manage different sets of hosts and library servers. If, for example, VMHost01 is currently managed by VMMServerA, you can add VMHost01 to VMMServerB by using the Add-SCVMHost cmdlet with the Reassociate parameter. If you do this, the state of VMHost01 on VMMServerA is now Access Denied and its state on VMMServerB is Responding. VMHost01 is now managed by VMMServerB, so you can remove it from VMMServerA.

You can also use Reassociate-SCVMMManagedComputer to reassociate Host01 with VMMServerA.

Examples

Example 1: Re-associate all unassociated managed computers with a specific VMM server

PS C:\> Get-VMMServer -ComputerName "VMMServer01.Contoso.com"
PS C:\> $Credential = Get-Credential
PS C:\> Get-VMMManagedComputer | where {$_.State -eq "NotResponding"} | Register-SCVMMManagedComputer -Credential $Credential

The first command connects to VMMServer01 in the Contoso.com domain.

The second command uses Get-Credential to prompt you to supply a user name and password and stores your credentials in the $Credential variable. The required credentials for this operation are a domain account with administrator rights on the host server that you want to reassociate with a specific VMM server and the password for that account.

The last command gets all managed computers from VMMServer01 and selects only those objects that are in the Not Responding state. Then, it passes these objects to the Register-SCVMMManagedComputer cmdlet which changes the association of the objects to VMMerver01. As this command is processed, $Credential provides your credentials to Register-SCVMMManagedComputer.

Parameters

-Credential

Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task.

For more information about the PSCredential object, type Get-Help Get-Credential.

For more information about Run As accounts, type Get-Help New-SCRunAsAccount.

Type:VMMCredential
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMMManagedComputer

Specifies a computer object that is managed by VMM.

Type:VMMManagedComputer
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Outputs

VMMManagedComputer

This cmdlet returns a VMMManagedComputer object.