New-SCPhysicalComputerProfile
创建用于将操作系统部署到计算机的配置文件。
语法
New-SCPhysicalComputerProfile
[-Name] <String>
-VirtualHardDisk <VirtualHardDisk>
-Domain <String>
-DomainJoinRunAsAccount <RunAsAccount>
-LocalAdministratorCredential <VMMCredential>
[-UseAsVMHost]
-PhysicalComputerNetworkAdapterProfile <PhysicalComputerNetworkAdapterProfile[]>
[-ComputerAccessRunAsAccount <RunAsAccount>]
[-DiskConfiguration <String>]
[-DriverMatchingTag <System.Collections.Generic.List`1[System.String]>]
[-VMPaths <String>]
[-FullName <String>]
[-IsGuarded <Boolean>]
[-CodeIntegrityPolicy <CodeIntegrityPolicy>]
[-GuiRunOnceCommands <String[]>]
[-OrganizationName <String>]
[-ProductKey <String>]
[-TimeZone <Int32>]
[-Baseline <Baseline[]>]
[-JobGroup <Guid>]
[-Description <String>]
[-Owner <String>]
[-AnswerFile <Script>]
[-BypassVHDConversion <Boolean>]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCPhysicalComputerProfile
[-Name] <String>
-VirtualHardDisk <VirtualHardDisk>
[-JoinWorkgroup]
-LocalAdministratorCredential <VMMCredential>
[-UseAsVMHost]
-PhysicalComputerNetworkAdapterProfile <PhysicalComputerNetworkAdapterProfile[]>
[-ComputerAccessRunAsAccount <RunAsAccount>]
[-DiskConfiguration <String>]
[-DriverMatchingTag <System.Collections.Generic.List`1[System.String]>]
[-VMPaths <String>]
[-FullName <String>]
[-IsGuarded <Boolean>]
[-CodeIntegrityPolicy <CodeIntegrityPolicy>]
[-GuiRunOnceCommands <String[]>]
[-OrganizationName <String>]
[-ProductKey <String>]
[-TimeZone <Int32>]
[-Baseline <Baseline[]>]
[-JobGroup <Guid>]
[-Description <String>]
[-Owner <String>]
[-AnswerFile <Script>]
[-BypassVHDConversion <Boolean>]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCPhysicalComputerProfile
[-Name] <String>
-VirtualHardDisk <VirtualHardDisk>
-Domain <String>
-DomainJoinRunAsAccount <RunAsAccount>
-LocalAdministratorCredential <VMMCredential>
[-UseAsFileServer]
-PhysicalComputerNetworkAdapterProfile <PhysicalComputerNetworkAdapterProfile[]>
[-ComputerAccessRunAsAccount <RunAsAccount>]
[-DiskConfiguration <String>]
[-DriverMatchingTag <System.Collections.Generic.List`1[System.String]>]
[-VMPaths <String>]
[-FullName <String>]
[-GuiRunOnceCommands <String[]>]
[-OrganizationName <String>]
[-ProductKey <String>]
[-TimeZone <Int32>]
[-JobGroup <Guid>]
[-Description <String>]
[-Owner <String>]
[-AnswerFile <Script>]
[-BypassVHDConversion <Boolean>]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCPhysicalComputerProfile
[-Name] <String>
-PhysicalComputerProfile <PhysicalComputerProfile>
[-Description <String>]
[-Owner <String>]
[-AnswerFile <Script>]
[-BypassVHDConversion <Boolean>]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
说明
New-SCPhysicalComputerProfile cmdlet 创建用于将操作系统部署到计算机的配置文件。
示例
示例 1:创建物理计算机配置文件
PS C:\> $Account = Get-SCRunaAsAccount -Name "CloudAdmin"
PS C:\> $Credential = Get-Credential "Contoso\ServiceAdmin"
PS C:\> $AdapterProfile = Get-SCPhysicalComputerNetworkAdapterProfile -ID "eede207d-d263-4212-ad32-fd29b5a1a6ce"
PS C:\> $Vhd = Get-SCVirtualHardDisk -Name "Win2012stdGen1template_disk_1.vhdx"
PS C:\> New-SCPhysicalComputerProfile -Name "ContosoHostProfile" -Domain "contoso.com" -DomainJoinRunAsAccount $Account -LocalAdministratorCredential $Credential -PhysicalComputerNetworkAdapterProfile $AdapterProfile -UseAsVMHost -VirtualHardDisk $Vhd
第一个命令获取运行方式帐户对象,并将其存储在名为$Account的变量中。
第二个命令为帐户 Contoso\ServiceAdmin 创建Windows PowerShell凭据对象,并将其存储在$Credential变量中。 必须将 ServiceAdmin 帐户的密码提供给 Get-Credential cmdlet。
第三个命令创建对具有指定 ID 的物理计算机网络适配器配置文件的对象引用,并将其存储在$AdapterProfile变量中。
第四个命令使用 Get-SCVirtualHardDisk cmdlet 创建对象引用。 此对象引用与虚拟硬盘 Win2012stdGen1template_disk_1.vhdx 相关联。
最后一个命令基于前面命令的值创建名为 ContosoHostProfile 的物理计算机配置文件。
参数
-AnswerFile
指定存储在 Virtual Machine Manager (VMM) 库中的脚本对象,以用作应答文件。 应答文件脚本的名称将根据虚拟机上安装的操作系统而有所不同:
- Sysprep.inf。 Windows XP、Windows Server 2000 或 Windows Server 2003
- Unattend.xml。 Windows Vista、Windows 7 或 Windows Server 2008
Type: | Script |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Baseline
指定基线对象的数组。
Type: | Baseline[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-BypassVHDConversion
指示在部署期间是否将附加到主机配置文件的动态 VHD 转换为固定类型。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CodeIntegrityPolicy
指定代码完整性策略。
Type: | CodeIntegrityPolicy |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ComputerAccessRunAsAccount
指定要用于部署计算机的运行方式帐户的计算机访问。 此运行方式帐户作为本地管理员添加到计算机,用于管理计算机。
Type: | RunAsAccount |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
指定计算机配置文件的说明。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DiskConfiguration
指定要使用 Windows Hyper-V 部署的物理计算机的磁盘和分区配置。
示例格式: -DiskConfiguration "MBR=1:PRIMARY:QUICK:4:FALSE:OS::0:BOOTPARTITION;"
必须确保指定正确的群集大小。 在上面的示例中,群集大小为 0。 如果未指定群集大小,VMM 将使用默认值 512 字节,这可能不适合配置高级格式磁盘。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Domain
为 Active Directory 域指定完全限定的域名 (FQDN)。
示例格式: -Domain "Domain01.Corp.Contoso.com"
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DomainJoinRunAsAccount
指定有权加入指定域的运行方式帐户。
Type: | RunAsAccount |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DriverMatchingTag
指定要在部署期间与驱动程序属性匹配的自定义标记。 指定标记后,部署过程会将主机配置文件中指定的标记与驱动程序中的标记匹配,以便下载匹配的驱动程序并将其安装在目标映像中。
Type: | System.Collections.Generic.List`1[System.String] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FullName
指定注册虚拟机所用的个人姓名。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-GuiRunOnceCommands
指定要添加到无人参与应答文件的 [GuiRunOnce] 节的命令数组。 对用双引号括起来的每个字符串使用单引号。
示例格式: -GuiRunOnceCommands '"C:\APF\APFPostSysPrepCopy.cmd PARAMS1"', '"C:\APF\APFPostSysPrepCopy.cmd PARAMS1"'
有关如何Windows PowerShell使用引号的信息,请键入 Get-Help about_Quoting_Rules
。
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IsGuarded
指示主机必须是受保护的主机。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobGroup
在运行最后一个包含相同作业组标识符的命令之前,为作为集合运行的一系列命令指定标识符。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定跟踪作业进度,并将其存储在此参数命名的变量中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JoinWorkgroup
指示此操作加入工作组。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LocalAdministratorCredential
在 Linux 兼容的来宾操作系统配置文件) 的情况下,指定本地管理员帐户 (或 Linux 根帐户的用户名和密码。
在新或现有模板、新来宾操作系统配置文件或新虚拟机上指定凭据会替代任何现有的管理员密码。
Type: | VMMCredential |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
指定 VMM 对象的名称。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OrganizationName
指定注册虚拟机名称的人员的组织名称。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Owner
以一个有效的域用户帐户形式指定 VMM 对象的所有者。
- 示例格式:
-Owner "Contoso\PattiFuller"
- 示例格式:
-Owner "PattiFuller@Contoso"
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PhysicalComputerNetworkAdapterProfile
指定物理计算机网络适配器配置文件对象的数组。
Type: | PhysicalComputerNetworkAdapterProfile[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PhysicalComputerProfile
指定用于将操作系统部署到计算机的配置文件。
Type: | PhysicalComputerProfile |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ProductKey
指定产品密钥。 产品密钥是一个标识产品许可证的 25 位数字。 产品密钥可用于注册要安装在虚拟机或主机上的 VMM 或操作系统。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定触发此操作 (PRO 提示) 的性能和资源优化提示的 ID。 此参数允许审核 PRO 提示。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
指示作业以异步方式运行,以便控件立即返回到命令 shell。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TimeZone
指定一个数字 (索引) ,该索引标识共享同一标准时间的地理区域。
有关时区索引的列表,请参阅 Microsoft 时区索引值。http://go.microsoft.com/fwlink/?LinkId=120935
如果未指定时区,则用于虚拟机的默认时区是虚拟机主机上的同一时区设置。
指定 GMT 标准时区的示例格式: -TimeZone 085
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UseAsFileServer
将配置文件标记为文件服务器配置文件。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UseAsVMHost
将配置文件标记为虚拟机主机配置文件。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VirtualHardDisk
指定虚拟硬盘对象。
Type: | VirtualHardDisk |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定VMM 服务器对象。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMPaths
指定主机上可用于存储虚拟机文件的一组默认路径(作为用管道运算符分隔的字符串)。
示例格式: -VMPaths "C:\Folder1|C:\Folder2|C:\Folder3"
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
输出
PhysicalComputerProfile
此 cmdlet 返回 PhysicalComputerProfile 对象。