Set-AzVmssOsProfile

Sets the VMSS operating system profile properties.

Syntax

Set-AzVmssOsProfile
   [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
   [[-ComputerNamePrefix] <String>]
   [[-AdminUsername] <String>]
   [[-AdminPassword] <String>]
   [[-CustomData] <String>]
   [[-WindowsConfigurationProvisionVMAgent] <Boolean>]
   [[-WindowsConfigurationEnableAutomaticUpdate] <Boolean>]
   [[-TimeZone] <String>]
   [[-AdditionalUnattendContent] <AdditionalUnattendContent[]>]
   [[-Listener] <WinRMListener[]>]
   [[-LinuxConfigurationDisablePasswordAuthentication] <Boolean>]
   [[-PublicKey] <SshPublicKey[]>]
   [[-Secret] <VaultSecretGroup[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-AzVmssOsProfile cmdlet sets the Virtual Machine Scale Set operating system profile properties.

Examples

Example 1: Set the operating system profile properties for a VMSS

PS C:\> Set-AzVmssOSProfile -VirtualMachineScaleSet "ContosoVMSS" -ComputerNamePrefix "Test" -AdminUsername $AdminUsername -AdminPassword $AdminPassword

This command sets operating system profile properties for the virtual machines that belong to the VMSS named ContosoVMSS. The command sets the computer name prefix for all the virtual machine instances in the VMSS to Test and supplies the administrator username and password.

Parameters

-AdditionalUnattendContent

Specifies an unattended content object. You can use the Add-AzVMAdditionalUnattendContent to create the object.

Type:AdditionalUnattendContent[]
Position:8
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-AdminPassword

Specifies the administrator password to use for all the virtual machine instances in the VMSS.

Type:String
Position:3
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-AdminUsername

Specifies the administrator account name to use for all the virtual machine instances in the VMSS.

Type:String
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ComputerNamePrefix

Specifies the computer name prefix for all the virtual machine instances in the VMSS. Computer names must be 1 to 15 characters long.

Type:String
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomData

Specifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes.

Type:String
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LinuxConfigurationDisablePasswordAuthentication

Indicates that this cmdlet disables password authentication.

Type:Boolean
Position:10
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Listener

Specifies the Windows Remote Management (WinRM) listeners. This enables remote Windows PowerShell. You can use the Add-AzVmssWinRMListener cmdlet to create the listener.

Type:WinRMListener[]
Position:9
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PublicKey

Specifies the Secure Shell (SSH) public key object. You can use the Add-AzVMSshPublicKey cmdlet to create the object.

Type:SshPublicKey[]
Position:11
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Secret

Specifies the secrets object which contains the certificate references to place on the virtual machine. You can use the Add-AzVmssSecret cmdlet to create the secrets object.

Type:VaultSecretGroup[]
Position:12
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-TimeZone

Specifies the time zone for the virtual machine.

Type:String
Position:7
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-VirtualMachineScaleSet

Specifies the VMSS object. You can use the New-AzVmssConfig cmdlet to create the object.

Type:PSVirtualMachineScaleSet
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WindowsConfigurationEnableAutomaticUpdate

Indicates whether the virtual machines in the VMSS are enabled for automatic updates.

Type:Boolean
Position:6
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WindowsConfigurationProvisionVMAgent

Indicates whether virtual machine agent should be provisioned on the virtual machines in the VMSS.

Type:Boolean
Position:5
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

VirtualMachineScaleSet

Parameter 'VirtualMachineScaleSet' accepts value of type 'VirtualMachineScaleSet' from the pipeline

Outputs

This cmdlet does not generate any output.