New-SCGuestOSProfile
Creates a guest operating system profile for use in VMM.
Syntax
New-SCGuestOSProfile
[-Shielded <Boolean>]
[-GuiRunOnceCommands <String[]>]
[-MergeAnswerFile <Boolean>]
[-AnswerFile <Script>]
[-OperatingSystem <OperatingSystem>]
[-VMMServer <ServerConnection>]
[-Name] <String>
[-Description <String>]
[-FullName <String>]
[-OrganizationName <String>]
[-ComputerName <String>]
[-ProductKey <String>]
[-LocalAdministratorCredential <VMMCredential>]
[-TimeZone <Int32>]
[-RemoveServerFeatures]
[-GuestOSProfile <GuestOSProfile>]
[-Owner <String>]
[-UserRole <UserRole>]
[-AutoLogonCredential <RunAsAccount>]
[-AutoLogonCount <UInt32>]
[-DisableAutoLogon]
[-UnattendSettings <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-DomainJoinOrganizationalUnit <String>]
[-RemoveDomainJoinOrganizationalUnit]
[-LinuxDomainName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCGuestOSProfile
[-Shielded <Boolean>]
[-GuiRunOnceCommands <String[]>]
[-MergeAnswerFile <Boolean>]
[-AnswerFile <Script>]
[-OperatingSystem <OperatingSystem>]
[-LinuxAdministratorSSHKey <SSHKey>]
[-VMMServer <ServerConnection>]
[-Name] <String>
[-Description <String>]
[-FullName <String>]
[-OrganizationName <String>]
[-ComputerName <String>]
[-ProductKey <String>]
[-LocalAdministratorCredential <VMMCredential>]
[-TimeZone <Int32>]
[-RemoveServerFeatures]
[-GuestOSProfile <GuestOSProfile>]
[-Owner <String>]
[-UserRole <UserRole>]
[-AutoLogonCredential <RunAsAccount>]
[-AutoLogonCount <UInt32>]
[-DisableAutoLogon]
[-UnattendSettings <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-DomainJoinOrganizationalUnit <String>]
[-RemoveDomainJoinOrganizationalUnit]
[-LinuxDomainName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCGuestOSProfile
[-Shielded <Boolean>]
[-GuiRunOnceCommands <String[]>]
[-MergeAnswerFile <Boolean>]
[-AnswerFile <Script>]
[-OperatingSystem <OperatingSystem>]
[-LinuxAdministratorSSHKeyString <String>]
[-VMMServer <ServerConnection>]
[-Name] <String>
[-Description <String>]
[-FullName <String>]
[-OrganizationName <String>]
[-ComputerName <String>]
[-ProductKey <String>]
[-LocalAdministratorCredential <VMMCredential>]
[-TimeZone <Int32>]
[-RemoveServerFeatures]
[-GuestOSProfile <GuestOSProfile>]
[-Owner <String>]
[-UserRole <UserRole>]
[-AutoLogonCredential <RunAsAccount>]
[-AutoLogonCount <UInt32>]
[-DisableAutoLogon]
[-UnattendSettings <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-DomainJoinOrganizationalUnit <String>]
[-RemoveDomainJoinOrganizationalUnit]
[-LinuxDomainName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCGuestOSProfile
[-Shielded <Boolean>]
[-GuiRunOnceCommands <String[]>]
[-MergeAnswerFile <Boolean>]
[-AnswerFile <Script>]
[-OperatingSystem <OperatingSystem>]
[-VMMServer <ServerConnection>]
[-Name] <String>
[-Description <String>]
[-FullName <String>]
[-OrganizationName <String>]
[-ComputerName <String>]
[-ProductKey <String>]
[-LocalAdministratorCredential <VMMCredential>]
[-TimeZone <Int32>]
[-RemoveServerFeatures]
-Domain <String>
[-DeploymentTypeNano <Boolean>]
[-DomainJoinCredential <VMMCredential>]
[-GuestOSProfile <GuestOSProfile>]
[-Owner <String>]
[-UserRole <UserRole>]
[-AutoLogonCredential <RunAsAccount>]
[-AutoLogonCount <UInt32>]
[-DisableAutoLogon]
[-UnattendSettings <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-DomainJoinOrganizationalUnit <String>]
[-RemoveDomainJoinOrganizationalUnit]
[-LinuxDomainName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCGuestOSProfile
[-Shielded <Boolean>]
[-GuiRunOnceCommands <String[]>]
[-MergeAnswerFile <Boolean>]
[-AnswerFile <Script>]
[-OperatingSystem <OperatingSystem>]
[-VMMServer <ServerConnection>]
[-Name] <String>
[-Description <String>]
[-FullName <String>]
[-OrganizationName <String>]
[-ComputerName <String>]
[-ProductKey <String>]
[-LocalAdministratorCredential <VMMCredential>]
[-TimeZone <Int32>]
[-RemoveServerFeatures]
[-Workgroup <String>]
[-GuestOSProfile <GuestOSProfile>]
[-Owner <String>]
[-UserRole <UserRole>]
[-AutoLogonCredential <RunAsAccount>]
[-AutoLogonCount <UInt32>]
[-DisableAutoLogon]
[-UnattendSettings <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-DomainJoinOrganizationalUnit <String>]
[-RemoveDomainJoinOrganizationalUnit]
[-LinuxDomainName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Description
The New-SCGuestOSProfile cmdlet creates a guest operating system profile for use in Virtual Machine Manager (VMM). A guest operating system is the operating system on a virtual machine, in contrast to a host operating system which is on the physical host computer on which one or more virtual machines are deployed.
A guest operating system profile stores operating system configuration information. A profile consists of a set of properties containing the most common settings specified in an unattended answer file (such as a Sysprep.inf or an Unattend.xml file).
You can create a standalone guest operating system profile or customize a template or virtual machine to include guest operating system profile settings. The New-SCGuestOSProfile cmdlet stores the new guest operating system profile object in the VMM library.
You can create a guest operating system profile based on default settings, based on an existing guest operating system profile, or you can customize settings as you create the profile. If you specify no parameters except the Name parameter, the New-SCGuestOSProfile cmdlet creates a default guest operating system profile object.
Examples
Example 1: Create a default guest operating system profile
PS C:\> $OS = Get-SCOperatingSystem -VMMServer "VMMServer01.Contoso.com" | where {$_.Name -eq "64-bit edition of Windows Server 2008 R2 Enterprise"}
PS C:\> New-SCGuestOSProfile -Name "NewOSProfile01" -OperatingSystem $OS
The first command gets the operating system object named "64-bit edition of Windows Server 2008 R2 Enterprise" from VMMServer01 and stores the object in the $OS variable.
The second command creates a default guest operating system profile named NewProfile01 and specifies the name of the operating system.
Example 2: Create a guest operating system profile to use to join a virtual machine to a domain
PS C:\> $DomainCredential = Get-SCRunAsAccount -Name "RunAsAccount01"
PS C:\> $OS = Get-SCOperatingSystem -VMMServer "VMMServer01.Contoso.com" | where {$_.Name -eq "64-bit edition of Windows Server 2008 R2 Enterprise"}
PS C:\> New-SCGuestOSProfile -Name "NewOSProfile02" -JoinDomain "Contoso.com" -DomainJoinCredential $DomainCredential -OperatingSystem $OS
The first command gets the Run As account object named RunAsAccount01 and stores the object in the $DomainCredential variable.
The second command gets the operating system object named 64-bit edition of Windows Server 2008 R2 Enterprise from VMMServer01 and stores the object in the $OS variable.
The last command creates a guest operating system profile called NewOSProfile02 and specifies the name of the operating system. When you use NewOSProfile02 to create a virtual machine, the profile uses the specified Run As account to join the virtual machine to the Contoso.com domain.
Note: If you provide a PSCredential object instead of a RunAs account for the DomainJoinCredential parameter, it is recommended practice to use only an account with limited rights for automatically joining a virtual machine to a domain because the domain account name and password appear briefly in plain text on the host server.
Example 3: Clone an existing guest operating system profile
PS C:\> $OSProfile = Get-SCGuestOSProfile -Name "NewOSProfile02"
PS C:\> $OS = Get-SCOperatingSystem -VMMServer "VMMServer01.contoso.com" | where {$_.Name -eq "64-bit edition of Windows Server 2008 R2 Datacenter"}
PS C:\> New-SCGuestOSProfile -Name "NewOSProfile03" -GuestOSProfile $OSProfile -ComputerName "Contoso03" -OperatingSystem $OS
The first command gets the guest OS profile object named NewOSProfile02 and stores the object in the $OSProfile variable.
The second command gets the operating system object named 64-bit edition of Windows Server 2008 R2 Datacenter and stores the object in the $OS variable.
The last command creates guest operating system profile named NewOSProfile03, which is based on NewOSProfile02, but modifies the computer name and specifies a different name for the operating system. All other settings in NewOSProfile03 are identical to those in NewOSProfile02.
Example 4: Create a Linux guest operating system profile and set the Linux DNS domain name
PS C:\> $OS = Get-SCOperatingSystem -VMMServer "VMMServer01.Contoso.com" | where {$_.Name -eq "CentOS Linux 6 (64 bit)"}
PS C:\> New-SCGuestOSProfile -Name "My CentOS Profile" -LinuxDomainName "contoso.com" -OperatingSystem $os
The first command gets the operating system object named CentOS Linux 6 (64 bit) from VMMServer01 and stores the object in the $OS variable.
The second command creates a guest operating system profile named My CentOS Profile and specifies the name of the operating system and the Linux DNS domain name. When you use the My CentOS Profile to create a virtual machine, the profile uses the specified Linux DNS domain name.
Parameters
-AnswerFile
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
Type: | Script |
Aliases: | SysPrepFile |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AutoLogonCount
Specifies the number of times that Windows should automatically log the administrator specified in the answer file on to the console session.
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AutoLogonCredential
Specifies the Run As account contained in the answer file that Windows uses to log on to the console session when automatic administrator logon is enabled.
Type: | RunAsAccount |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ComputerName
Specifies the name of a computer that VMM can uniquely identify on your network. The acceptable values for this parameter are:
- FQDN
- IPv4 or IPv6 address
- NetBIOS name
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DeploymentTypeNano
{{Fill DeploymentTypeNano Description}}
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
Specifies a description for the guest operating system profile.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableAutoLogon
Indicates that this cmdlet disables automatic administrator logon.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Domain
Specifies a fully qualified domain name (FQDN) for an Active Directory domain.
Example format: -Domain "Domain01.Corp.Contoso.com"
Type: | String |
Aliases: | JoinDomain |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DomainJoinCredential
Specifies the user name and password of an account that has permission to join a computer to the domain. We recommend that you use a limited rights account joining computers to the domain. This includes both virtual and physical computers.
You can use the current parameter to specify credentials on a VMHostProfile for joining a physical host computer to the domain, or to specify credentials, on a new or existing template, on a new or existing guest operating system profile, or on a new virtual machine, for joining a virtual machine to the domain.
Type: | VMMCredential |
Aliases: | JoinDomainCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DomainJoinOrganizationalUnit
Specifies the organizational unit to which the computer is joined during an unattended mini-setup.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FullName
Specifies the name of the person in whose name a virtual machine is registered.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-GuestOSProfile
Specifies a guest operating system profile object.
Type: | GuestOSProfile |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | 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
.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
Specifies that job progress is tracked and stored in the variable named by this parameter.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LinuxAdministratorSSHKey
Specifies the public key file for a Linux SSH Key.
Type: | SSHKey |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LinuxAdministratorSSHKeyString
Specifies a Linux administrator SSH key as a string.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LinuxDomainName
Specifies a fully qualified domain name (FQDN) to use in conjunction with Linux operating system specialization.
Example format: -LinuxDomainName "Domain01.Corp.Contoso.com"
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | VMMCredential |
Aliases: | AdminPasswordCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MergeAnswerFile
Indicates whether this cmdlet merges the answer file together with guest operating system settings. The default value is $True. VMM console uses this parameter. Do not specify this parameter.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specifies the name of a VMM object.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OperatingSystem
Specifies the type of operating system for a virtual machine.
To get the names of all available operating systems in VMM, type Get-SCOperatingSystem
.
Type: | OperatingSystem |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OrganizationName
Specifies the name of the organization for the person in whose name a virtual machine is registered.
Type: | String |
Aliases: | OrgName |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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"
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RemoveDomainJoinOrganizationalUnit
Indicates that this cmdlet removes the organizational unit that the computer joined during setup.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RemoveServerFeatures
Indicates that this cmdlet removes all server roles and features from a template.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Shielded
Indicates whether the object is shielded.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UnattendSettings
Specifies a key/value pair consisting of String, String.
Type: | System.Collections.Generic.Dictionary`2[System.String,System.String] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserRole
Specifies a user role object.
Type: | UserRole |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
Specifies a VMM server object.
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Workgroup
Specifies on a new or existing template, on a new or existing guest operating system profile, or on a new virtual machine the name of the workgroup to which you want to join a virtual machine. You can use this parameter to override the existing value on a template or on a guest operating system profile.
Type: | String |
Aliases: | JoinWorkgroup |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Outputs
GuestOSProfile
This cmdlet returns a GuestOSProfile object.