Compartilhar via


Set-SCGuestOSProfile

Changes the properties of a guest operating system profile used in VMM.

Syntax

Default (Default)

Set-SCGuestOSProfile
    [-GuestOSProfile] <GuestOSProfile>
    [-ProductKey <String>]
    [-GuiRunOnceCommands <String[]>]
    [-LocalAdministratorCredential <VMMCredential>]
    [-MergeAnswerFile <Boolean>]
    [-AnswerFile <Script>]
    [-OperatingSystem <OperatingSystem>]
    [-LinuxDomainName <String>]
    [-Shielded <Boolean>]
    [-Name <String>]
    [-Description <String>]
    [-FullName <String>]
    [-OrganizationName <String>]
    [-ComputerName <String>]
    [-TimeZone <Int32>]
    [-RemoveServerFeatures]
    [-Owner <String>]
    [-UserRole <UserRole>]
    [-AutoLogonCredential <RunAsAccount>]
    [-AutoLogonCount <UInt32>]
    [-DisableAutoLogon]
    [-UnattendSettings <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
    [-DomainJoinOrganizationalUnit <String>]
    [-RemoveDomainJoinOrganizationalUnit]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<CommonParameters>]

Domain

Set-SCGuestOSProfile
    [-GuestOSProfile] <GuestOSProfile>
    -Domain <String>
    [-ProductKey <String>]
    [-GuiRunOnceCommands <String[]>]
    [-LocalAdministratorCredential <VMMCredential>]
    [-MergeAnswerFile <Boolean>]
    [-DomainJoinCredential <VMMCredential>]
    [-AnswerFile <Script>]
    [-OperatingSystem <OperatingSystem>]
    [-LinuxDomainName <String>]
    [-Shielded <Boolean>]
    [-Name <String>]
    [-Description <String>]
    [-FullName <String>]
    [-OrganizationName <String>]
    [-ComputerName <String>]
    [-TimeZone <Int32>]
    [-RemoveServerFeatures]
    [-DeploymentTypeNano <Boolean>]
    [-Owner <String>]
    [-UserRole <UserRole>]
    [-AutoLogonCredential <RunAsAccount>]
    [-AutoLogonCount <UInt32>]
    [-DisableAutoLogon]
    [-UnattendSettings <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
    [-DomainJoinOrganizationalUnit <String>]
    [-RemoveDomainJoinOrganizationalUnit]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<CommonParameters>]

SSHKeyFile

Set-SCGuestOSProfile
    [-GuestOSProfile] <GuestOSProfile>
    [-ProductKey <String>]
    [-GuiRunOnceCommands <String[]>]
    [-LocalAdministratorCredential <VMMCredential>]
    [-MergeAnswerFile <Boolean>]
    [-AnswerFile <Script>]
    [-OperatingSystem <OperatingSystem>]
    [-LinuxDomainName <String>]
    [-LinuxAdministratorSSHKey <SSHKey>]
    [-Shielded <Boolean>]
    [-Name <String>]
    [-Description <String>]
    [-FullName <String>]
    [-OrganizationName <String>]
    [-ComputerName <String>]
    [-TimeZone <Int32>]
    [-RemoveServerFeatures]
    [-Owner <String>]
    [-UserRole <UserRole>]
    [-AutoLogonCredential <RunAsAccount>]
    [-AutoLogonCount <UInt32>]
    [-DisableAutoLogon]
    [-UnattendSettings <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
    [-DomainJoinOrganizationalUnit <String>]
    [-RemoveDomainJoinOrganizationalUnit]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<CommonParameters>]

SSHKeyString

Set-SCGuestOSProfile
    [-GuestOSProfile] <GuestOSProfile>
    [-ProductKey <String>]
    [-GuiRunOnceCommands <String[]>]
    [-LocalAdministratorCredential <VMMCredential>]
    [-MergeAnswerFile <Boolean>]
    [-AnswerFile <Script>]
    [-OperatingSystem <OperatingSystem>]
    [-LinuxDomainName <String>]
    [-LinuxAdministratorSSHKeyString <String>]
    [-Shielded <Boolean>]
    [-Name <String>]
    [-Description <String>]
    [-FullName <String>]
    [-OrganizationName <String>]
    [-ComputerName <String>]
    [-TimeZone <Int32>]
    [-RemoveServerFeatures]
    [-Owner <String>]
    [-UserRole <UserRole>]
    [-AutoLogonCredential <RunAsAccount>]
    [-AutoLogonCount <UInt32>]
    [-DisableAutoLogon]
    [-UnattendSettings <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
    [-DomainJoinOrganizationalUnit <String>]
    [-RemoveDomainJoinOrganizationalUnit]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<CommonParameters>]

Workgroup

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

Description

The Set-SCGuestOSProfile cmdlet changes one or more properties of a guest operating system profile used in a Virtual Machine Manager (VMM) environment. Changes made to a guest operating system profile affect only the guest operating system profile itself. Changes do not affect any existing virtual machines that were previously created by using this profile.

Examples

Example 1: Specify an organization name for an existing guest operating system profile

PS C:\> $OSProfile = Get-SCGuestOSProfile -Name "NewOSProfile01"
PS C:\> Set-SCGuestOSProfile -GuestOSProfile $OSProfile -OrgName "Contoso"

The first command gets the guest OS profile object named NewOSProfile01 and stores the object in the $OSProfile variable.

The second command sets Contoso as the organization name for the guest operating system profile stored in $OSProfile.

Example 2: Specify an SSHKey for an existing Linux guest operating system profile

Caution

This article references CentOS, a Linux distribution that has reached End Of Life (EOL) status. Please consider your use and planning accordingly. For more information, see the CentOS End Of Life guidance.

PS C:\> $OSProfile = Get-SCGuestOSProfile -Name "My CentOS Profile"
PS C:\> $Sshkey = Get-SCSSHKey -Name "My.Sshkey"
PS C:\> Set-SCGuestOSProfile -GuestOSProfile $OSProfile -LinuxAdministratorSSHKey $Sshkey

The first command gets the guest OS profile object named MyCentOSProfile and stores the object in the $OSProfile variable.

The second command gets the SSHKey object named My.Sshkey and stores the object in the $Sshkey variable.

The last command sets the My.sshkey object on the guest operating system profile stored in $OSProfile.

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

Parameter properties

Type:Script
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SysPrepFile

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-AutoLogonCount

Specifies the number of times that Windows should automatically log the administrator specified in the answer file on to the console session.

Parameter properties

Type:UInt32
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

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

Parameter properties

Type:RunAsAccount
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

-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

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

-DeploymentTypeNano

{{Fill DeploymentTypeNano Description}}

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Domain
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 guest operating system 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

-DisableAutoLogon

Disables automatic administrator logon.

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

-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
Aliases:JoinDomain

Parameter sets

Domain
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:VMMCredential
Default value:None
Supports wildcards:False
DontShow:False
Aliases:JoinDomainCredential

Parameter sets

Domain
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DomainJoinOrganizationalUnit

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

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

-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

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-GuestOSProfile

Specifies a guest operating system profile object.

Parameter properties

Type:GuestOSProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
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

(All)
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

-LinuxAdministratorSSHKey

Specifies the public key file for a Linux SSH Key.

Parameter properties

Type:SSHKey
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SSHKeyFile
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LinuxAdministratorSSHKeyString

Specifies a Linux administrator SSH key as a string.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SSHKeyString
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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"

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

-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
Aliases:AdminPasswordCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

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

-Name

Specifies the name of a VMM object.

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

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

Parameter properties

Type:OperatingSystem
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

-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
Aliases:OrgName

Parameter sets

(All)
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

-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

(All)
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

-RemoveDomainJoinOrganizationalUnit

Indicates that this cmdlet removes the organizational unit that the computer joined during setup.

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

-RemoveServerFeatures

Indicates that this cmdlet removes all server roles and features from a template.

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

-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

-Shielded

Indicates whether the object is shielded.

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

-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

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UnattendSettings

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

Parameter properties

Type:

System.Collections.Generic.Dictionary`2[System.String,System.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

-UserRole

Specifies a user role object.

Parameter properties

Type:UserRole
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

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:JoinWorkgroup

Parameter sets

Workgroup
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

GuestOSProfile

This cmdlet returns a GuestOSProfile object.

Notes

  • Requires a VMM guest OS profile object, which can be retrieved by using the Get-SCGuestOSProfile cmdlet.