Share via


Add-SCVMHost

Add-SCVMHost

Adds a computer as a virtual machine host.

Syntax

Parameter Set: DomainJoined
Add-SCVMHost [-ComputerName] <String> -Credential <VMMCredential> [-AvailableForPlacement <Boolean]> ] [-BaseDiskPaths <String> ] [-CPUPercentageReserve <UInt16]> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64]> ] [-EnableLiveMigration <Boolean]> ] [-IsDedicatedToNetworkVirtualizationGateway <Boolean]> ] [-JobVariable <String> ] [-LiveMigrationMaximum <UInt32]> ] [-LiveStorageMigrationMaximum <UInt32]> ] [-MaintenanceHost <Boolean]> ] [-MaxDiskIOReservation <UInt64]> ] [-MemoryReserveMB <UInt64]> ] [-MigrationAuthProtocol <MigrationAuthProtocolType]> ] [-MigrationPerformanceOption <MigrationPerformanceOptionType]> ] [-MigrationSubnet <String[]> ] [-NetworkPercentageReserve <UInt16]> ] [-PROTipID <Guid]> ] [-Reassociate <Boolean]> ] [-RemoteConnectEnabled <Boolean]> ] [-RemoteConnectPort <UInt32]> ] [-RunAsynchronously] [-UseAnyMigrationSubnet <Boolean]> ] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: Clustered
Add-SCVMHost [-ComputerName] <String> -Credential <VMMCredential> -VMHostCluster <HostCluster> [-AvailableForPlacement <Boolean]> ] [-BaseDiskPaths <String> ] [-Certificate <ClientCertificate> ] [-CPUPercentageReserve <UInt16]> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64]> ] [-EnableLiveMigration <Boolean]> ] [-EnableSecureMode <Boolean> ] [-IsDedicatedToNetworkVirtualizationGateway <Boolean]> ] [-JobVariable <String> ] [-LiveMigrationMaximum <UInt32]> ] [-LiveStorageMigrationMaximum <UInt32]> ] [-MaintenanceHost <Boolean]> ] [-MaxDiskIOReservation <UInt64]> ] [-MemoryReserveMB <UInt64]> ] [-MigrationAuthProtocol <MigrationAuthProtocolType]> ] [-MigrationPerformanceOption <MigrationPerformanceOptionType]> ] [-MigrationSubnet <String[]> ] [-NetworkPercentageReserve <UInt16]> ] [-PROTipID <Guid]> ] [-Reassociate <Boolean]> ] [-RemoteConnectEnabled <Boolean]> ] [-RemoteConnectPort <UInt32]> ] [-RunAsynchronously] [-TCPPort <UInt32]> ] [-UseAnyMigrationSubnet <Boolean]> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: ESXHost
Add-SCVMHost [-ComputerName] <String> -Credential <VMMCredential> -VirtualizationManager <VirtualizationManager> [-AvailableForPlacement <Boolean]> ] [-BaseDiskPaths <String> ] [-Certificate <ClientCertificate> ] [-CPUPercentageReserve <UInt16]> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64]> ] [-EnableLiveMigration <Boolean]> ] [-JobVariable <String> ] [-LiveMigrationMaximum <UInt32]> ] [-LiveStorageMigrationMaximum <UInt32]> ] [-MaintenanceHost <Boolean]> ] [-MaxDiskIOReservation <UInt64]> ] [-MemoryReserveMB <UInt64]> ] [-MigrationAuthProtocol <MigrationAuthProtocolType]> ] [-MigrationPerformanceOption <MigrationPerformanceOptionType]> ] [-MigrationSubnet <String[]> ] [-NetworkPercentageReserve <UInt16]> ] [-PROTipID <Guid]> ] [-Reassociate <Boolean]> ] [-RemoteConnectEnabled <Boolean]> ] [-RemoteConnectPort <UInt32]> ] [-RunAsynchronously] [-SshPublicKey <ClientSshPublicKey> ] [-SshPublicKeyFile <String> ] [-SshTcpPort <UInt32]> ] [-TCPPort <UInt32]> ] [-UseAnyMigrationSubnet <Boolean]> ] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: NonTrustedDomain
Add-SCVMHost [-ComputerName] <String> -Credential <VMMCredential> -NonTrustedDomainHost [-AvailableForPlacement <Boolean]> ] [-BaseDiskPaths <String> ] [-CPUPercentageReserve <UInt16]> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64]> ] [-EnableLiveMigration <Boolean]> ] [-IsDedicatedToNetworkVirtualizationGateway <Boolean]> ] [-JobVariable <String> ] [-LiveMigrationMaximum <UInt32]> ] [-LiveStorageMigrationMaximum <UInt32]> ] [-MaintenanceHost <Boolean]> ] [-MaxDiskIOReservation <UInt64]> ] [-MemoryReserveMB <UInt64]> ] [-MigrationAuthProtocol <MigrationAuthProtocolType]> ] [-MigrationPerformanceOption <MigrationPerformanceOptionType]> ] [-MigrationSubnet <String[]> ] [-NetworkPercentageReserve <UInt16]> ] [-PROTipID <Guid]> ] [-Reassociate <Boolean]> ] [-RemoteConnectEnabled <Boolean]> ] [-RemoteConnectPort <UInt32]> ] [-RunAsynchronously] [-UseAnyMigrationSubnet <Boolean]> ] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: PerimeterNetwork
Add-SCVMHost [-ComputerName] <String> -EncryptionKey <PSCredential> -PerimeterNetworkHost -SecurityFile <String> [-AvailableForPlacement <Boolean]> ] [-BaseDiskPaths <String> ] [-CPUPercentageReserve <UInt16]> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64]> ] [-EnableLiveMigration <Boolean]> ] [-JobVariable <String> ] [-LiveMigrationMaximum <UInt32]> ] [-LiveStorageMigrationMaximum <UInt32]> ] [-MaintenanceHost <Boolean]> ] [-MaxDiskIOReservation <UInt64]> ] [-MemoryReserveMB <UInt64]> ] [-MigrationAuthProtocol <MigrationAuthProtocolType]> ] [-MigrationPerformanceOption <MigrationPerformanceOptionType]> ] [-MigrationSubnet <String[]> ] [-NetworkPercentageReserve <UInt16]> ] [-PROTipID <Guid]> ] [-Reassociate <Boolean]> ] [-RemoteConnectEnabled <Boolean]> ] [-RemoteConnectPort <UInt32]> ] [-RunAsynchronously] [-UseAnyMigrationSubnet <Boolean]> ] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: XenServerHost
Add-SCVMHost [-ComputerName] <String> -Credential <VMMCredential> -XenServerHost [-AvailableForPlacement <Boolean]> ] [-BaseDiskPaths <String> ] [-Certificate <ClientCertificate> ] [-CPUPercentageReserve <UInt16]> ] [-Description <String> ] [-DiskSpaceReserveMB <UInt64]> ] [-EnableLiveMigration <Boolean]> ] [-EnableSecureMode <Boolean> ] [-JobVariable <String> ] [-LiveMigrationMaximum <UInt32]> ] [-LiveStorageMigrationMaximum <UInt32]> ] [-MaintenanceHost <Boolean]> ] [-MaxDiskIOReservation <UInt64]> ] [-MemoryReserveMB <UInt64]> ] [-MigrationAuthProtocol <MigrationAuthProtocolType]> ] [-MigrationPerformanceOption <MigrationPerformanceOptionType]> ] [-MigrationSubnet <String[]> ] [-NetworkPercentageReserve <UInt16]> ] [-PROTipID <Guid]> ] [-Reassociate <Boolean]> ] [-RemoteConnectEnabled <Boolean]> ] [-RemoteConnectPort <UInt32]> ] [-RunAsynchronously] [-TCPPort <UInt32]> ] [-UseAnyMigrationSubnet <Boolean]> ] [-VMHostGroup <HostGroup> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Detailed Description

The Add-SCVMHost cmdlet adds one or more computers as virtual machine hosts to Virtual Machine Manager (VMM). A virtual machine host is a physical computer managed by VMM whose role is to host one or more virtual machines.

From the perspective of networking and domains, the types of hosts supported in System Center 2012 - VMM include:

-- Domain-joined Windows host. The host can be located in either a trusted or untrusted domain.
-- Perimeter network Windows host. A non-domain-joined Windows host can be managed in the same way as a perimeter network Windows host that is located in a domain.
-- A VMware ESX host. ESX hosts do not use Windows Active Directory domains.
-- A Citrix XenServer host. XenServer hosts are managed in the same way whether or not they are configured to use Windows Active Directory.

From the perspective of virtualization platform and operating system, the types of hosts supported in System Center 2012 - VMM include:

-- Hyper-V hosts. A server running Windows Server 2008 or later with the Hyper-V role enabled.
-- VMware ESX hosts. A VMware ESX host running proprietary software, including a hypervisor, that is managed by a VMware vCenter Server running Windows.
-- Citrix XenServer hosts. A Citrix XenServer server running proprietary software, including a hypervisor.

System Center 2012 - VMM manages these three types of hosts, even though each host type implements virtualization in a different way. The following paragraphs describe each type of host in more detail. For more information, see System Requirements: Virtual Machine Hosts (https://go.microsoft.com/fwlink/?LinkId=217486) in the Microsoft TechNet Library.

Before you add a Hyper-V host, review System Requirements: Hyper-V Hosts (https://go.microsoft.com/fwlink/?LinkID=213749) in the Microsoft TechNet Library.

The Add-SCVMHost cmdlet enables the Hyper-V server role for you, but you must first manually configure the Virtualization option in the BIOS.

To manage a Windows-based host in a perimeter network:

-- Install the Virtual Machine Manager agent locally on the perimeter network host.
-- When you run VMM Setup and choose the option indicating that this host is on a perimeter network, the wizard prompts you to provide an encryption key for the security file and to specify where you want to store the security file.
-- After you have installed the local agent, obtain the security file from the folder in which it is stored. The default location is: C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager, and the name of the security file is SecurityFile.txt.
-- Copy the security file to a location that is accessible to the computer on which a VMM console is installed.
-- When you use Add-SCVMHost to add the perimeter network host, you must specify the same encryption key and point to the local security file by using the EncryptionKey and SecurityFile parameters.

Before you add a VMWare ESX host, see System Requirements: VMware ESX Hosts (https://go.microsoft.com/fwlink/?LinkID=215885) in the Microsoft TechNet Library.

Before you add a Citrix XenServer host, see System Requirements: Citrix XenServer Hosts (https://go.microsoft.com/fwlink/?LinkId=217487) in the Microsoft TechNet Library.

Parameters

-AvailableForPlacement<Boolean]>

Indicates whether the VMM placement process considers this host or this volume on a host to be eligible as a possible location on which to deploy virtual machines. If this parameter is set to $False, you can choose to deploy virtual machines on this host or volume anyway. The default value is $True. This parameter does not apply to VMware ESX hosts.

When this parameter is used with network adapters, if set to $False, then placement does not consider the logical networks configured on this network adapter to determine if the host is suitable for connecting a virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BaseDiskPaths<String>

Specifies the paths of base disks.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Certificate<ClientCertificate>

Specifies a security certificate object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ComputerName<String>

Specifies the name of a computer that VMM can uniquely identify on your network. Valid formats are:

-- FQDN
-- IPv4 or IPv6 address
-- NetBIOS name

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPUPercentageReserve<UInt16]>

Specifies the percentage of CPU to reserve for the use of the operating system on the physical host computer. If you specify this parameter, this cmdlet uses the default setting for the host group, which is 10 percent. The VMM placement process does not recommend that a virtual machine be placed on a host unless its resource requirements can be met without using host reserves.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Credential<VMMCredential>

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.

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

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Description<String>

Specifies a description for the hosts that this cmdlet adds.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DiskSpaceReserveMB<UInt64]>

Specifies, in megabytes, the amount of disk space to reserve for the use of the operating system on the physical host computer. If you do not specify this parameter, this cmdlet uses the default setting for the host group, which is 100 MB. The VMM placement process does not recommend that a virtual machine be placed on a host unless its resource requirements can be met without using host reserves.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableLiveMigration<Boolean]>

Indicates whether live migration is enabled on the host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableSecureMode<Boolean>

Indicates whether VMM communicates with VMware ESX hosts and Citrix XenServer hosts in secure mode. The default value is $True.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EncryptionKey<PSCredential>

Specifies credentials to be used as an encryption key when you add a Hyper-V host located in a perimeter network to VMM.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IsDedicatedToNetworkVirtualizationGateway<Boolean]>

Indicates whether the host is dedicated to a network virtualization gateway.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LiveMigrationMaximum<UInt32]>

Specifies the maximum number of simultaneous live migrations.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LiveStorageMigrationMaximum<UInt32]>

Specifies the maximum number of simultaneous live storage migrations.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaintenanceHost<Boolean]>

This parameter is obsolete. Use AvailableForPlacement instead.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaxDiskIOReservation<UInt64]>

Specifies the maximum disk I/O per second (IOPS) on the physical host computer. If you do not specify this parameter, this cmdlet uses the default setting for the host group, which is 10000. The VMM placement process does not recommend that a virtual machine be placed on a host unless its resource requirements can be met without using host reserves.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MemoryReserveMB<UInt64]>

Specifies the amount of memory, in megabytes, to reserve for the use of the host operating system on the physical host computer. If you do not specify this parameter, this cmdlet uses the default setting for the host group, which is 256 MB. The VMM placement process does not recommend that a virtual machine be placed on a host unless its resource requirements can be met without using host reserves.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MigrationAuthProtocol<MigrationAuthProtocolType]>

Specifies the authorization protocol used for migration. Valid values are: CredSSP and Kerberos.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MigrationPerformanceOption<MigrationPerformanceOptionType]>

Specifies the migration performance option type. Valid values are:

-- Standard
-- UseCompression
-- UseSmbTransport

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MigrationSubnet<String[]>

Specifies an array of subnets to use for migration.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NetworkPercentageReserve<UInt16]>

Specifies the percentage of network capacity to reserve for the use of the host operating system on the physical host computer. If you do not specify parameter, this cmdlet uses the default setting for the host group, which is 10 percent. The VMM placement process does not recommend that a virtual machine be placed on a host unless its resource requirements can be met without using host reserves.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NonTrustedDomainHost

Indicates that the host to add to VMM belongs to a non-trusted domain.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PerimeterNetworkHost

Indicates that the host to add to VMM is located in a perimeter network.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Reassociate<Boolean]>

Indicates whether this cmdlet reassociates a host currently managed by one VMM server with another VMM server.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoteConnectEnabled<Boolean]>

Indicates whether to enable a connection on a host server that lets users connect to their virtual machines remotely. This parameter only applies to virtual machines on Hyper-V hosts. It is not applicable to virtual machines on VMware ESX hosts or Citrix XenServer hosts.

Aliases

VMRCEnabled

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoteConnectPort<UInt32]>

Specifies a default value for the TCP port to use when a remote user connects to a virtual machine. Typically, the default port for a Hyper-V host is 2179. This parameter does not apply to VMware ESX hosts or Citrix XenServer hosts.

Aliases

VMRCPort

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SecurityFile<String>

Specifies the path to a file that contains the certificate and credentials to use for authentication of a Hyper-V host located in a perimeter network. This parameter does not apply to VMware ESX hosts or Citrix XenServer hosts.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SshPublicKey<ClientSshPublicKey>

Specifies the public key used by Secure Shell (SSH) communications.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SshPublicKeyFile<String>

Specifies the path to the public key file for establishing a secured SSH channel with the target hosts.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SshTcpPort<UInt32]>

Specifies the TCP port number used by the SSH protocol.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TCPPort<UInt32]>

Specifies a numeric value that represents a TCP port.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UseAnyMigrationSubnet<Boolean]>

Indicates whether any subnet can be used for migration.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualizationManager<VirtualizationManager>

Specifies a virtualization manager object managed by VMM.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHostCluster<HostCluster>

Specifies a VMM host cluster object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHostGroup<HostGroup>

Specifies a virtual machine host group object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMPaths<String>

Specifies a set of default paths, as strings separated by the pipeline operator, on a host where virtual machine files can be stored. Specify paths in the following format:

C:\Folder01|C:\Folder02|C:\Folder03

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-XenServerHost

Indicates that the host to add to VMM is a Citrix XenServer host.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Host

Examples

Example 1: Add a host in the same domain as the VMM server

The first command gets the Run As account object named HostComputer RunAsAccount, and then stores the object in the $RunAsAccount variable. The required credentials for this operation are either a local Administrator account or a domain account with administrator rights on the computer that you want to add as a host.

The second command adds the host object named VMHost01 in the Contoso domain to VMM as a managed host, specifies a description, enables remote connections, and specifies that TCP port 5900 is used for remote connections to VMHost01. As the last command is processed, $RunAsAccount provides credentials to Add-SCVMHost.

PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAcct01"
PS C:\> Add-SCVMHost "VMHost01.Contoso.com" -Description "This is a new host" -RemoteConnectEnabled $True -RemoteConnectPort 5900 -Credential $RunAsAccount

Example 2: Add a host located in a perimeter network to VMM

The first command prompts you for a user name and password, and then stores the credentials in $Key. The user name can be any user name, but the password must be the same encryption key that was used when the VMM agent was installed on this computer. The VMM agent must be installed locally on a computer located in a perimeter network by choosing the local agent option when you run Setup. You specify the encryption key for the security file on the Security File Folder page of the System Center Virtual Machine Manager Agent Setup wizard.

The second command adds a host object that represents the computer named VMHost02 to the VMM database as a managed host. The command adds a description, disables remote connections, and specifies that this host is located in a perimeter network. This command uses the credentials stored in $Key to decrypt the contents of SecurityFile.txt (which, in this example, is located at C:\) and then uses the contents of SecurityFile.txt to authenticate the new host.

PS C:\> $Key = Get-SCCredential
PS C:\> Add-SCVMHost "VMHost02" -Description "This is my new perimeter network host" -RemoteConnectEnabled $False -PerimeterNetworkHost -SecurityFile "C:\SecurityFile.txt" -EncryptionKey $Key

Example 3: Add a host located in a non-trusted domain to VMM

The first command gets the Run As account object named RunAsAccount02, and stores the object in the $RunAsAccount variable. The required credentials for this operation are an account with administrator rights to add a host located in the non-trusted domain to the VMM server in the Contoso.com domain.

The second command adds VMHost03, located in a domain that is not trusted by Contoso.com, to the VMM database as a managed host. As this command is processed, $RunAsAccount provides credentials to Add-SCVMHost.

PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAccount02"
PS C:\> Add-SCVMHost "VMHost03.NonTrustedDomain.com" -VMMServer "VMMServer01.Contoso.com" -NonTrustedDomainHost -Credential $RunAsAccount

Example 4: Add a VMware ESX host to VMM

The first command gets the host group object named HostGroup02, and then stores the object in the $HostGroup variable.

The second command gets the Run As account object named ESX Host Computer Acct, and then stores the object in the $RunAsAccount variable.

The third command gets the virtualization manager object named VirtMgrServer02, and then stores the object in the $VirtMgr variable.

The last command adds ESX Host01 to HostGroup02. The command provides the credentials in the form of a Run As account stored in $RunAsAccount, which is required to add this host to VMM.

PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup02"
PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "ESX Host Computer Acct"
PS C:\> $VirtMgr = Get-SCVirtualizationManager -ComputerName "VirtMgrServer02.Contoso.com"
PS C:\> Add-SCVMHost -ComputerName "ESXHost01.Contoso.com" -Credential $RunAsAccount -VirtualizationManager $VirtMgr -VMHostGroup $HostGroup

Example 5: Add a Citrix XenServer host to VMM

The first command gets the host group object named HostGroup04, and then stores the object in the $HostGroup variable.

The second command gets the Run As account object named XenServer Host Computer Acct, and then stores the object in the $RunAsAccount variable. The required credentials for this operation are an account with root credentials on the XenServer host.

The third command gets the certificate object for XenServerHost01, and then stores the object in the $Certificate variable.

The last command adds a XenServer as a host to HostGroup04 in VMM and provides the credentials in the form of a Run As account stored in $RunAsAccount, which is required to add this host to VMM.

PS C:\> $HostGroup = Get-SCVMHostGroup -Name "HostGroup04"
PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "XenServer Run As Acct"
PS C:\> $Certificate = Get-SCCertificate -ComputerName "XenServerHost01.Contoso.com"
PS C:\> Add-SCVMHost -ComputerName "XenServerHost01.Contoso.com" -Credential $RunAsAccount -VMHostGroup $HostGroup -XenServerHost -Certificate $Certificate -EnableSecureMode $True -TCPPort 5989

Disable-SCVMHost

Enable-SCVMHost

Get-SCVMHost

Move-SCVMHost

New-SCVMHost

Read-SCVMHost

Register-SCVMHost

Remove-SCVMHost

Repair-SCVMHost

Restart-SCVMHost

Set-SCVMHost

Start-SCVMHost

Stop-SCVMHost

Get-SCVMHostCluster

Get-SCVMHostGroup

New-SCVirtualMachine

Get-SCCertificate

Get-SCRunAsAccount