The first command gets the Run As account object and stores it in a variable named $Account.
The second command creates a Windows PowerShell credentials object for the account Contoso\ServiceAdmin and stores it in the $Credential variable.
You must supply the password for the ServiceAdmin account to the Get-Credential cmdlet.
The third command creates an object reference to the physical computer network adapter profile that has the specified ID and stores it in the $AdapterProfile variable.
The fourth command creates an object reference by using the Get-SCVirtualHardDisk cmdlet.
This object references is associated with the virtual hard disk Win2012stdGen1template_disk_1.vhdx.
The final command creates a physical computer profile named ContosoHostProfile based on the values from previous commands.
Parameters
-AnswerFile
Specifies a script object stored in the Virtual Machine Manager (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
Parameter properties
Type:
Script
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Baseline
Specifies an array of Baseline objects.
Parameter properties
Type:
Baseline[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-BypassVHDConversion
Indicates whether a dynamic VHD attached to a host profile is converted to a fixed type during deployment.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-CodeIntegrityPolicy
Specifies a code integrity policy.
Parameter properties
Type:
CodeIntegrityPolicy
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ComputerAccessRunAsAccount
Specifies the computer access Run As account to use to deploy the computer.
This Run As account is added to the machine as a local administrator and used to manage the machine.
Parameter properties
Type:
RunAsAccount
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Description
Specifies a description for the computer profile.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DiskConfiguration
Specifies the disk and partition configuration for the physical computer that is to be deployed with Windows Hyper-V.
Example format: -DiskConfiguration "MBR=1:PRIMARY:QUICK:4:FALSE:OS::0:BOOTPARTITION;"
You must be sure to specify the correct cluster size.
In the example above, the cluster size is 0.
If you do not specify a cluster size, VMM uses the default of 512 bytes, which may be unsuitable to configure advanced format disks.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Domain
Specifies a fully qualified domain name (FQDN) for an Active Directory domain.
Example format: -Domain "Domain01.Corp.Contoso.com"
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DomainJoinRunAsAccount
Specifies a Run As account that has permission to join the specified domain.
Parameter properties
Type:
RunAsAccount
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DriverMatchingTag
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.
Parameter properties
Type:
System.Collections.Generic.List`1[System.String]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-FullName
Specifies the name of the person in whose name a virtual machine is registered.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-GuiRunOnceCommands
Specifies an array of commands to add to the [GuiRunOnce] section of an unattended answer file.
Use single quotation marks around each string enclosed in double quotation marks.
Example format:
-GuiRunOnceCommands '"C:\APF\APFPostSysPrepCopy.cmd PARAMS1"', '"C:\APF\APFPostSysPrepCopy.cmd PARAMS1"'
For information about how Windows PowerShell uses quotation marks, type Get-Help about_Quoting_Rules.
Parameter properties
Type:
String[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-IsGuarded
Indicates that the host needs to be a Guarded Host.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-JobGroup
Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.
Parameter properties
Type:
Guid
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-JobVariable
Specifies that job progress is tracked and stored in the variable named by this parameter.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-JoinWorkgroup
Indicates that this operation joins a workgroup.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-LocalAdministratorCredential
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.
Parameter properties
Type:
VMMCredential
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Name
Specifies the name of a VMM object.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
0
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-OrganizationName
Specifies the name of the organization for the person in whose name a virtual machine is registered.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Owner
Specifies the owner of a VMM object in the form of a valid domain user account.
Example format: -Owner "Contoso\PattiFuller"
Example format: -Owner "PattiFuller@Contoso"
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-PhysicalComputerNetworkAdapterProfile
Specifies an array of physical computer network adapter profile objects.
Parameter properties
Type:
PhysicalComputerNetworkAdapterProfile[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-PhysicalComputerProfile
Specifies a profile that is used to deploy an operating system to a computer.
Parameter properties
Type:
PhysicalComputerProfile
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CloneProfile
Position:
Named
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ProductKey
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.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
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.
Parameter properties
Type:
Guid
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-TimeZone
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
Parameter properties
Type:
Int32
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-UseAsFileServer
Marks the profile as a file server profile.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewFileServerProfile
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-UseAsVMHost
Marks the profile as a virtual machine host profile.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VirtualHardDisk
Specifies a virtual hard disk object.
Parameter properties
Type:
VirtualHardDisk
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VMMServer
Specifies a VMM server object.
Parameter properties
Type:
ServerConnection
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VMPaths
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"
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
CreateNewHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewWorkgroupHostProfileData
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CreateNewFileServerProfile
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
Outputs
PhysicalComputerProfile
This cmdlet returns a PhysicalComputerProfile object.