Set-AzureRmVmssOsProfile
Sets the VMSS operating system profile properties.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
Set-AzureRmVmssOsProfile
[-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-AzureRmVmssOsProfile 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-AzureRmVmssOSProfile -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-AzureRmVMAdditionalUnattendContent 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: | Nullable<T>[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-AzureRmVmssWinRMListener 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-AzureRmVMSshPublicKey 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-AzureRmVmssSecret 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-AzureRmVmssConfig 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: | Nullable<T>[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: | Nullable<T>[Boolean] |
Position: | 5 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
Nullable<T>[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]