New-SCVMHostProfile

Creates a host profile.

Description

The New-SCVMHostProfile cmdlet creates a host profile, Host profiles contain the hardware and operating system configuration settings used to deploy a physical computer as a Hyper-V host.

Before you create a host profile, ensure that the .vhd file that you specify exists in a library share.

For more information about New-SCVMHostProfile, type: "Get-Help New-SCVMHostProfile -online".

Parameters

Name

Required? true
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

VMHostProfile

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a virtual machine host profile object.

AnswerFile

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a script object stored in the VMM library to use as an answer file. The name of the answer file script depends on the operating system that you want to install on a virtual machine:

 ANSWER FILE	GUEST OS TO INSTALL ON VM
 -----------	-------------------------
 Sysprep.inf	Windows XP, Windows Server 2000, or Windows Server 2003
 Unattend.xml   Windows Vista, Windows 7, or Windows Server 2008 

BypassVHDConversion

Required? false
Accept Pipeline Input? false
Position? named
Indicates that a dynamic VHD attached to a host profile is not converted to a fixed type during deployment.

Description

Required? false
Accept Pipeline Input? false
Position? named
States a description for the specified object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

Owner

Required? false
Accept Pipeline Input? false
Position? named
Specifies the owner of a VMM object in the form of a valid domain user account.

Example format: -Owner "Contoso\ReneeLo"
Example format: -Owner "ReneeLo@Contoso"

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Name

Required? true
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

Domain

Required? true
Accept Pipeline Input? false
Position? named
Specifies a fully qualified domain name (FQDN) for an Active Directory domain. 

Example format: -Domain "Domain01.Corp.Contoso.com"

DomainJoinRunAsAccount

Required? true
Accept Pipeline Input? false
Position? named
Specifies a Run As account that has permission to join the specified domain.

VirtualHardDisk

Required? true
Accept Pipeline Input? false
Position? named
Specifies a virtual hard disk object.

AnswerFile

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a script object stored in the VMM library to use as an answer file. The name of the answer file script depends on the operating system that you want to install on a virtual machine:

 ANSWER FILE	GUEST OS TO INSTALL ON VM
 -----------	-------------------------
 Sysprep.inf	Windows XP, Windows Server 2000, or Windows Server 2003
 Unattend.xml   Windows Vista, Windows 7, or Windows Server 2008 

BypassVHDConversion

Required? false
Accept Pipeline Input? false
Position? named
Indicates that a dynamic VHD attached to a host profile is not converted to a fixed type during deployment.

Description

Required? false
Accept Pipeline Input? false
Position? named
States a description for the specified object.

DiskConfiguration

Required? false
Accept Pipeline Input? false
Position? named
Specifies the disk and partition configuration for the physical computer that is to be deployed with Windows Hyper-V.

DriverMatchingTag

Required? false
Accept Pipeline Input? false
Position? named
Specifies the custom tags to match with driver properties during deployment. When tags are specified, the deployment process matches the tags specified in the host profile with the tags in the drivers in order to download matching drivers and install them in the target image.

FullName

Required? false
Accept Pipeline Input? false
Position? named
Specifies the name of the person in whose name a virtual machine is registered. 

GuiRunOnceCommands

Required? false
Accept Pipeline Input? false
Position? named
Specifies one or more commands to add to the [GuiRunOnce] section of an unattended answer file (such as Unattend.xml). Use single quotes around each string enclosed in double quotes.

Example format:
-GuiRunOnceCommands '"C:\APF\APFPostSysPrepCopy.cmd PARAMS1"', '"C:\APF\APFPostSysPrepCopy.cmd PARAMS1"'

For information about how Windows PowerShell uses quotes, type: "Get-Help about_Quoting_Rules"

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

LocalAdministratorCredential

Required? false
Accept Pipeline Input? false
Position? named
Specifies the user name and password for the local Administrator account. Specifying credentials on a new or existing template, on a new or existing guest operating system profile, or on a new virtual machine overrides any existing Administrator password.

LogicalNetwork

Required? false
Accept Pipeline Input? false
Position? named
Specifies a logical network. A logical network is a named grouping of IP subnets and VLANs that is used to organize and simplify network assignments.

OrganizationName

Required? false
Accept Pipeline Input? false
Position? named
Specifies the name of the organization for the person in whose name a virtual machine is registered. 

Owner

Required? false
Accept Pipeline Input? false
Position? named
Specifies the owner of a VMM object in the form of a valid domain user account.

Example format: -Owner "Contoso\ReneeLo"
Example format: -Owner "ReneeLo@Contoso"

ProductKey

Required? false
Accept Pipeline Input? false
Position? named
Specifies a product key. The product key is a 25-digit number that identifies the product license. A product key can be used to register VMM or an operating system to be installed on a virtual machine or host.

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

TimeZone

Required? false
Accept Pipeline Input? false
Position? named
Specifies a number (an index) that identifies a geographical region that shares the same standard time. For a list of time zone indexes, see "Microsoft Time Zone Index Values" at: http://go.microsoft.com/fwlink/?LinkId=120935. If no time zone is specified, the default time zone used for a virtual machine is the same time zone setting that is on the virtual machine host.

Example format to specify the GMT Standard Time zone: -TimeZone 085

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

VMPaths

Required? false
Accept Pipeline Input? false
Position? named
Specifies a set of default paths (as strings separated by the pipeline operator) on a host where virtual machine files can be stored.

Example format: -VMPaths "C:\Folder1|C:\Folder2|C:\Folder3"

Examples

1: Create a host profile.
PS C:\> $VHD = Get-SCVirtualHardDisk -Name "VHD01.vhd"
PS C:\> $RunAsAcct = Get-SCRunAsAccount -Name "RunAsAcct01"
PS C:\> $Credential = Get-Credential
PS C:\> $HostProfile = New-SCVMHostProfile -Name "HostProfile01" -Owner "Contoso\Katarina" -Description "Host Profile 01" -Domain "Contoso.com" -DomainJoinRunAsAccount $RunAsAcct -VirtualHardDisk $VHD -AdminPasswordCredential $Credential
PS C:\> $HostProfile

The first command gets the virtual hard disk object named VHD01.vhd and stores the object in the $VHD variable.

The second command prompts you for credentials. At the prompt, enter the credentials of an Administrator account. The command stores the credentials in the $Credential variable.

The third command creates a host profile named HostProfile01 using the virtual hard disk stored in $VHD, and the credentials stored in $Credential.

The last command displays information about the newly created host profile to the user.
2: Clone an existing host profile.
PS C:\> $OrigHostProfile = Get-SCVMHostProfile -Name "HostProfile01"
PS C:\> $NewHostProfile = New-SCVMHostProfile -Name "HostProfile02" -VMHostProfile $OrigHostProfile
The first command gets the host profile object named HostProfile01 and stores the object in the $OrigHostProfile variable.

The second command copies the host profile stored in $OrigHostProfile, gives it the specified name, and stores the new profile object in the $NewHostProfile variable.

See Also