New-SCVMHostProfile

New-SCVMHostProfile

Creates a host profile.

構文

Parameter Set: CloneProfile
New-SCVMHostProfile [-Name] <String> -VMHostProfile <PhysicalComputerProfile> [-AnswerFile <Script> ] [-BypassVHDConversion <Boolean]> ] [-Description <String> ] [-JobVariable <String> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: CreateNewFileServerProfile
New-SCVMHostProfile [-Name] <String> -Domain <String> -DomainJoinRunAsAccount <RunAsAccount> -LocalAdministratorCredential <VMMCredential> -VirtualHardDisk <VirtualHardDisk> [-AnswerFile <Script> ] [-BypassVHDConversion <Boolean]> ] [-Description <String> ] [-DiskConfiguration <String> ] [-DriverMatchingTag <0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [-FullName <String> ] [-GuiRunOnceCommands <String[]> ] [-JobVariable <String> ] [-OrganizationName <String> ] [-Owner <String> ] [-ProductKey <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-TimeZone <Int32]> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: CreateNewHostProfileData
New-SCVMHostProfile [-Name] <String> -Domain <String> -DomainJoinRunAsAccount <RunAsAccount> -LocalAdministratorCredential <VMMCredential> -VirtualHardDisk <VirtualHardDisk> [-AnswerFile <Script> ] [-BypassVHDConversion <Boolean]> ] [-Description <String> ] [-DiskConfiguration <String> ] [-DriverMatchingTag <0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [-FullName <String> ] [-GuiRunOnceCommands <String[]> ] [-JobVariable <String> ] [-OrganizationName <String> ] [-Owner <String> ] [-ProductKey <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-TimeZone <Int32]> ] [-VMHostNetworkAdapterProfile <PhysicalComputerNetworkAdapterProfile[]> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

Parameter Set: CreateNewWorkgroupHostProfileData
New-SCVMHostProfile [-Name] <String> -JoinWorkgroup -LocalAdministratorCredential <VMMCredential> -VirtualHardDisk <VirtualHardDisk> [-AnswerFile <Script> ] [-BypassVHDConversion <Boolean]> ] [-Description <String> ] [-DiskConfiguration <String> ] [-DriverMatchingTag <0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [-FullName <String> ] [-GuiRunOnceCommands <String[]> ] [-JobVariable <String> ] [-OrganizationName <String> ] [-Owner <String> ] [-ProductKey <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-TimeZone <Int32]> ] [-VMMServer <ServerConnection> ] [-VMPaths <String> ] [ <CommonParameters>]

詳細説明

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.

パラメーター

-AnswerFile<Script>

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:

-- Sysprep.inf. Windows XP, Windows Server 2000, or Windows Server 2003.
-- Unattend.xml. Windows Vista, Windows 7, or Windows Server 2008.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-BypassVHDConversion<Boolean]>

Indicates whether a dynamic VHD attached to a host profile is converted to a fixed type during deployment.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Description<String>

States a description for the specified object.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-DiskConfiguration<String>

Specifies the disk and partition configuration for the physical computer that is to be deployed with Windows Hyper-V.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Domain<String>

Specifies a fully qualified domain name (FQDN) for an Active Directory domain.

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

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-DomainJoinRunAsAccount<RunAsAccount>

Specifies a Run As account that has permission to join the specified domain.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-DriverMatchingTag<0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

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.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-FullName<String>

Specifies the name of the person in whose name a virtual machine is registered.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-GuiRunOnceCommands<String[]>

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.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-JobVariable<String>

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

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-JoinWorkgroup

Indicates that the computer joins a workgroup.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-LocalAdministratorCredential<VMMCredential>

Specifies the user name and password for the Local Administrator account (or Linux root account in the case of a Linux compatible Guest Operating System profile).

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.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Name<String>

Specifies the name of a VMM object.

エイリアス

none

必須?

true

位置は?

1

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-OrganizationName<String>

Specifies the name of the organization for the person in whose name a virtual machine is registered.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Owner<String>

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"

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ProductKey<String>

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.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-RunAsynchronously

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

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-TimeZone<Int32]>

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 (https://go.microsoft.com/fwlink/?LinkId=120935) on the Microsoft Developer Network. 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

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-VirtualHardDisk<VirtualHardDisk>

Specifies a virtual hard disk object.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-VMHostNetworkAdapterProfile<PhysicalComputerNetworkAdapterProfile[]>

Specifies a host network adapter profile object or objects.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-VMHostProfile<PhysicalComputerProfile>

Specifies a virtual machine host profile object.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

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.

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

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • HostProfile

Example 1: Create a host profile

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

The second command gets a Run As account that has the name RunAsAcct01, and then saves it in the $RunAsAccnt variable.

The third command prompts you for credentials. At the prompt, enter the credentials of an Administrator account. For more information, type Get-Help Get-Credential. The command stores the credentials in the $Credential variable.

The fourth command creates a host profile named HostProfile01 using the virtual hard disk stored in $VHD, and the credentials stored in $Credential, and then stores it in the $HostProfile variable.

The last command displays information about the newly created host profile to the user.

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 -LocalAdministratorCredential $Credential
PS C:\> $HostProfile

Example 2: Clone an existing host profile

The first command gets the host profile object named HostProfile01, and then stores the object in the $OrigHostProfile variable.

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

PS C:\> $OrigHostProfile = Get-SCVMHostProfile -Name "HostProfile01"
PS C:\> $NewHostProfile = New-SCVMHostProfile -Name "HostProfile02" -VMHostProfile $OrigHostProfile

Example 3: Create a host profile that includes a host network adapter profile

The first command gets the virtual hard disk object named VHDX01.vhdx, and then stores the object in the $VHDX variable.

The second command gets the Run As account object named DomainJoinRAA, and then stores the object in the $DomainJoinCreds variable.

The third command prompts the user for local administrator credentials, and then stores the provided credentials in the $LocalAdminCreds variable.

The fourth command gets the host network adapter profile object with the ID of 259f47c7-c5a9-429d-a421-d232f9b34991, and then stores the object in the $HostNetAdapterProf variable.

The last command creates a host profile named Host Profile 03 using VHDX01 and the host network adapter profile stored in $HostNetAdapterProf.

PS C:\> $VHDX = Get-SCVirtualHardDisk -Name "VHDX01.vhdx"
PS C:\> $DomainJoinCreds = Get-SCRunAsAccount -Name "DomainJoinRAA"
PS C:\> $LocalAdminCreds = Get-Credential
PS C:\> $HostNetAdapterProf = Get-SCVMHostNetworkAdapterProfile -ID "259f47c7-c5a9-429d-a421-d232f9b34991"
PS C:\> New-SCVMHostProfile -Name "HostProfile03" -Owner "Contoso\Katarina" -Description "Host Profile 03" -Domain "Contoso.com" -DomainJoinRunAsAccount $DomainJoinCreds -VirtualHardDisk $VHDX -LocalAdministratorCredential $LocalAdminCreds -VMHostNetworkAdapterProfile $HostNetAdapterProf

関連トピック

Get-SCVMHostProfile

Remove-SCVMHostProfile

Set-SCVMHostProfile

Get-SCRunAsAccount

Get-SCVirtualHardDisk

Get-SCVMHostNetworkAdapterProfile