New-SCGuestOSProfile

New-SCGuestOSProfile

Creates a guest operating system profile for use in VMM.

Syntax

Parameter Set: Default
New-SCGuestOSProfile [-Name] <String> [-AnswerFile <Script> ] [-AutoLogonCount <UInt32> ] [-AutoLogonCredential <RunAsAccount> ] [-ComputerName <String> ] [-Description <String> ] [-DisableAutoLogon] [-DomainJoinOrganizationalUnit <String> ] [-FullName <String> ] [-GuestOSProfile <GuestOSProfile> ] [-GuiRunOnceCommands <String[]> ] [-JobVariable <String> ] [-LinuxDomainName <String> ] [-LocalAdministratorCredential <VMMCredential> ] [-MergeAnswerFile <Boolean> ] [-OperatingSystem <OperatingSystem> ] [-OrganizationName <String> ] [-Owner <String> ] [-ProductKey <String> ] [-PROTipID <Guid]> ] [-RemoveDomainJoinOrganizationalUnit] [-RemoveServerFeatures] [-RunAsynchronously] [-TimeZone <Int32]> ] [-UnattendSettings <Dictionary`2> ] [-UserRole <UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: Domain
New-SCGuestOSProfile [-Name] <String> -Domain <String> [-AnswerFile <Script> ] [-AutoLogonCount <UInt32> ] [-AutoLogonCredential <RunAsAccount> ] [-ComputerName <String> ] [-Description <String> ] [-DisableAutoLogon] [-DomainJoinCredential <VMMCredential> ] [-DomainJoinOrganizationalUnit <String> ] [-FullName <String> ] [-GuestOSProfile <GuestOSProfile> ] [-GuiRunOnceCommands <String[]> ] [-JobVariable <String> ] [-LinuxDomainName <String> ] [-LocalAdministratorCredential <VMMCredential> ] [-MergeAnswerFile <Boolean> ] [-OperatingSystem <OperatingSystem> ] [-OrganizationName <String> ] [-Owner <String> ] [-ProductKey <String> ] [-PROTipID <Guid]> ] [-RemoveDomainJoinOrganizationalUnit] [-RemoveServerFeatures] [-RunAsynchronously] [-TimeZone <Int32]> ] [-UnattendSettings <Dictionary`2> ] [-UserRole <UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: SSHKeyFile
New-SCGuestOSProfile [-Name] <String> [-AnswerFile <Script> ] [-AutoLogonCount <UInt32> ] [-AutoLogonCredential <RunAsAccount> ] [-ComputerName <String> ] [-Description <String> ] [-DisableAutoLogon] [-DomainJoinOrganizationalUnit <String> ] [-FullName <String> ] [-GuestOSProfile <GuestOSProfile> ] [-GuiRunOnceCommands <String[]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxDomainName <String> ] [-LocalAdministratorCredential <VMMCredential> ] [-MergeAnswerFile <Boolean> ] [-OperatingSystem <OperatingSystem> ] [-OrganizationName <String> ] [-Owner <String> ] [-ProductKey <String> ] [-PROTipID <Guid]> ] [-RemoveDomainJoinOrganizationalUnit] [-RemoveServerFeatures] [-RunAsynchronously] [-TimeZone <Int32]> ] [-UnattendSettings <Dictionary`2> ] [-UserRole <UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: SSHKeyString
New-SCGuestOSProfile [-Name] <String> [-AnswerFile <Script> ] [-AutoLogonCount <UInt32> ] [-AutoLogonCredential <RunAsAccount> ] [-ComputerName <String> ] [-Description <String> ] [-DisableAutoLogon] [-DomainJoinOrganizationalUnit <String> ] [-FullName <String> ] [-GuestOSProfile <GuestOSProfile> ] [-GuiRunOnceCommands <String[]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-LocalAdministratorCredential <VMMCredential> ] [-MergeAnswerFile <Boolean> ] [-OperatingSystem <OperatingSystem> ] [-OrganizationName <String> ] [-Owner <String> ] [-ProductKey <String> ] [-PROTipID <Guid]> ] [-RemoveDomainJoinOrganizationalUnit] [-RemoveServerFeatures] [-RunAsynchronously] [-TimeZone <Int32]> ] [-UnattendSettings <Dictionary`2> ] [-UserRole <UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: Workgroup
New-SCGuestOSProfile [-Name] <String> [-AnswerFile <Script> ] [-AutoLogonCount <UInt32> ] [-AutoLogonCredential <RunAsAccount> ] [-ComputerName <String> ] [-Description <String> ] [-DisableAutoLogon] [-DomainJoinOrganizationalUnit <String> ] [-FullName <String> ] [-GuestOSProfile <GuestOSProfile> ] [-GuiRunOnceCommands <String[]> ] [-JobVariable <String> ] [-LinuxDomainName <String> ] [-LocalAdministratorCredential <VMMCredential> ] [-MergeAnswerFile <Boolean> ] [-OperatingSystem <OperatingSystem> ] [-OrganizationName <String> ] [-Owner <String> ] [-ProductKey <String> ] [-PROTipID <Guid]> ] [-RemoveDomainJoinOrganizationalUnit] [-RemoveServerFeatures] [-RunAsynchronously] [-TimeZone <Int32]> ] [-UnattendSettings <Dictionary`2> ] [-UserRole <UserRole> ] [-VMMServer <ServerConnection> ] [-Workgroup <String> ] [ <CommonParameters>]

Detailed 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.

Parameters

-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.

Aliases

SysPrepFile

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-AutoLogonCount<UInt32>

Specifies the number of times that Windows should automatically log the administrator denoted in the Answer File on to the console session.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AutoLogonCredential<RunAsAccount>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ComputerName<String>

Specifies the name of a computer that VMM can uniquely identify on your network. Valid formats are:

-- FQDN
-- IPv4 or IPv6 address
-- NetBIOS name

NOTE: See the examples for a specific cmdlet to determine how that cmdlet specifies the computer name.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Description<String>

States a description for the specified object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DisableAutoLogon

Indicates that this cmdlet disables automatic administrator logon.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Domain<String>

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

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

Aliases

JoinDomain

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DomainJoinCredential<VMMCredential>

Specifies the user name and password of an account with permission to join a computer to the domain. A limited rights account should be used for joining computers (either physical or virtual) to the domain.

Example format for a Windows PowerShell credential:

$DomainJoinCredential = Get-Credential -Domain "ThisDomain.Corp.Contoso.com" -DomainJoinCredential $DomainJoinCredential

Example format for a Run As account:

$DomainJoinCredential = Get-SCRunAsAccount -Name "RunAsAcct01" -Domain "ThisDomain.Corp.Contoso.com" -DomainJoinCredential $DomainJoinCredential

NOTE: You can use the DomainJoinCredential 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.

Aliases

JoinDomainCredential

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DomainJoinOrganizationalUnit<String>

Specifies the organizational unit to which the computer is joined during an unattended mini-setup.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FullName<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-GuestOSProfile<GuestOSProfile>

Specifies a guest operating system profile object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LinuxAdministratorSSHKey<SSHKey>

Specifies the public key file for a Linux SSH Key.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LinuxAdministratorSSHKeyString<String>

Specifies, as a string, a Linux administrator SSH key.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LinuxDomainName<String>

Specifies a fully qualified domain name (FQDN) to be used in conjunction with Linux operating system specialization.

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

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.

Aliases

AdminPasswordCredential

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MergeAnswerFile<Boolean>

Indicates whether this cmdlet merges the specified answer file with the specified guest operating system settings. The default value is $True. This parameter is used by the VMM console. You do not need to use this parameter at the command prompt.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a VMM object.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OperatingSystem<OperatingSystem>

Specifies the type of operating system for a virtual machine. To list the names of all available operating systems in VMM, type Get-SCOperatingSystem.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OrganizationName<String>

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

Aliases

OrgName

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

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"

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoveDomainJoinOrganizationalUnit

Removes the organizational unit that the computer joined during setup.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoveServerFeatures

Removes all server roles and features from a template.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UnattendSettings<Dictionary`2>

Specifies a key/value pair consisting of string, string.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UserRole<UserRole>

Specifies a user role object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Workgroup<String>

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.

Aliases

JoinWorkgroup

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • GuestOSProfile

Examples

Example 1: Create a default guest operating system profile

The first command gets the operating system object named 64-bit edition of Windows Server 2008 R2 Enterprise from VMMServer01, and then 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.

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

Example 2: Create a guest operating system profile to use to join a virtual machine to a domain

The first command gets the Run As account object named RunAsAccount01 and then 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 then 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, you should 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.

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

Example 3: Clone an existing guest operating system profile

The first command gets the guest operating system profile object named NewOSProfile02, and then stores the object in the $OSProfile variable.

The second command gets the operating system object named 64-bit edition of Windows Server 2008 R2Datacenter, and then 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.

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

Example 4: Create a Linux guest operating system profile and set the Linux DNS domain name

The first command gets the operating system object named CentOS Linux 6 (64 bit) from VMMServer01, and then stores the object in the $OS variable.

The second command creates a guest operating system profile called 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.

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

Get-SCGuestOSProfile

Get-SCVMMServer

New-SCVirtualMachine

New-SCVMTemplate

Remove-SCGuestOSProfile

Set-SCGuestOSProfile

Set-SCVMTemplate

Get-SCOperatingSystem

Get-SCRunAsAccount