< Back

Add-AzureProvisioningConfig

Wed Jan 30, 2019 5:42 pm

NAME Add-AzureProvisioningConfig



SYNOPSIS

Adds provisioning configuration for an Azure virtual machine.





SYNTAX

Add-AzureProvisioningConfig -VM <IPersistentVM> [-DisableGuestAgent] [-CustomDataFile <String>] -Windows [-AdminUsername <String>] [-Password <String>]

[-ResetPasswordOnFirstLogon] [-DisableAutomaticUpdates] [-NoRDPEndpoint] [-TimeZone <String>] [-Certificates <CertificateSettingList>]

[-EnableWinRMHttp] [-DisableWinRMHttps] [-WinRMCertificate <X509Certificate2>] [-X509Certificates <X509Certificate2[]>] [-NoExportPrivateKey]

[-NoWinRMEndpoint] [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]



Add-AzureProvisioningConfig -VM <IPersistentVM> [-DisableGuestAgent] [-CustomDataFile <String>] [-AdminUsername <String>] [-Password <String>]

[-ResetPasswordOnFirstLogon] [-DisableAutomaticUpdates] [-NoRDPEndpoint] [-TimeZone <String>] [-Certificates <CertificateSettingList>]

[-EnableWinRMHttp] [-DisableWinRMHttps] [-WinRMCertificate <X509Certificate2>] [-X509Certificates <X509Certificate2[]>] [-NoExportPrivateKey]

[-NoWinRMEndpoint] [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] -WindowsDomain -JoinDomain

<String> -Domain <String> -DomainUserName <String> -DomainPassword <String> [-MachineObjectOU <String>] [<CommonParameters>]



Add-AzureProvisioningConfig -VM <IPersistentVM> [-DisableGuestAgent] [-CustomDataFile <String>] [-Password <String>] [-Profile <AzureSMProfile>]

[-InformationAction <ActionPreference>] [-InformationVariable <String>] -Linux [-LinuxUser <String>] [-DisableSSH] [-NoSSHEndpoint] [-NoSSHPassword]

[-SSHPublicKeys <LinuxProvisioningConfigurationSet+SSHPublicKeyList>] [-SSHKeyPairs <LinuxProvisioningConfigurationSet+SSHKeyPairList>]

[<CommonParameters>]





DESCRIPTION

The Add-AzureProvisioningConfig cmdlet adds provisioning configuration information to an Azure virtual machine configuration. You can use the

configuration object to create a virtual machine.



This cmdlet supports different provisioning configurations, including standalone Windows servers, Windows servers joined to an Active Directory domain,

and Linux-based servers.



To create an Active Directory domain joined server, specify the fully qualified domain name of the Active Directory domain and the domain credentials of

a user who has permission to join the machine to the domain.





PARAMETERS

-VM <IPersistentVM>

Specifies a virtual machine object.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-DisableGuestAgent [<SwitchParameter>]

Indicates that this configuration disables the infrastructure as a service (IaaS) guest agent.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-CustomDataFile <String>

Specifies a data file for the virtual machine. This cmdlet encodes the contents of the file as Base64. The file must be less than 64 kilobytes long.



If the guest operating system is the Windows operating system, this configuration saves this data as a binary file named

%SYSTEMDRIVE%\\AzureData\\CustomData.bin.



If the guest operating system is Linux, this configuration passes the data by using the ovf-env.xml file. Configuration copies that file to the

/var/lib/waagent directory. The agent also stores the Base64 encoded data in /var/lib/waagent/CustomData.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Windows [<SwitchParameter>]

Indicates that this configuration creates a standalone virtual machine that runs the Windows operating system.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-AdminUsername <String>

Specifies the user name of the Administrator account that this configuration creates on the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Password <String>

Specifies the password of the administrator account.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ResetPasswordOnFirstLogon [<SwitchParameter>]

Indicates that the virtual machine requires the user to change the password at the first logon.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DisableAutomaticUpdates [<SwitchParameter>]

Indicates that this configuration disables automatic updates.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-NoRDPEndpoint [<SwitchParameter>]

Indicates that this configuration creates a virtual machine without a remote desktop endpoint.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-TimeZone <String>

Specifies the time zone for the virtual machine, for example, Pacific Standard Time or Canada Central Standard Time.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Certificates <CertificateSettingList>

Specifies a set of certificates that this configuration installs on the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-EnableWinRMHttp [<SwitchParameter>]

Indicates that this configuration enables WinRM over HTTP.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DisableWinRMHttps [<SwitchParameter>]

Indicates that this configuration disables Windows Remote Management (WinRM) on HTTPS. By default, WinRM is enabled over HTTPS.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WinRMCertificate <X509Certificate2>

Specifies a certificate that this configuration associates to a WinRM endpoint.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-X509Certificates <X509Certificate2[]>

Specifies an array of X509 certificates that are deployed to a hosted service.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NoExportPrivateKey [<SwitchParameter>]

Indicates that this configuration does not upload the private key.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-NoWinRMEndpoint [<SwitchParameter>]

Indicates that this configuration does not add a WinRM endpoint for the virtual machine.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Profile <AzureSMProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Linux [<SwitchParameter>]

Indicates that this configuration creates a Linux configuration.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-LinuxUser <String>

Specifies the user name of the Linux administrative account that this configuration creates on the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DisableSSH [<SwitchParameter>]

Indicates that this configuration disables SSH.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-NoSSHEndpoint [<SwitchParameter>]

Indicates that this configuration creates a virtual machine without an SSH endpoint.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-NoSSHPassword [<SwitchParameter>]

Indicates that this configuration creates a virtual machine without an SSH password.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-SSHPublicKeys <LinuxProvisioningConfigurationSet+SSHPublicKeyList>

Specifies SSH public keys.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SSHKeyPairs <LinuxProvisioningConfigurationSet+SSHKeyPairList>

Specifies SSH key pairs.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-WindowsDomain [<SwitchParameter>]

Indicates that this configuration creates Windows server that is joined to an Active Directory domain.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-JoinDomain <String>

Specifies the fully qualified domain name (FQDN) of the domain to join.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Domain <String>

Specifies the name of the domain of the account that has permission to add the computer to a domain.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DomainUserName <String>

Specifies the name of the user account that has permission to add the computer to a domain.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DomainPassword <String>

Specifies the password of the user account that has permission to add the computer to a domain.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-MachineObjectOU <String>

Specifies the fully qualified name of the organizational unit (OU) in which the configuration creates the computer account.



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, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- Example 1: Create a standalone virtual machine --------------------------



PS C:\\>New-AzureVMConfig -Name "NonDomainVM" -InstanceSize Small -ImageName "Image07" | Add-AzureProvisioningConfig -Windows -Password "password"

-AdminUsername "AdminMain" | New-AzureVM -ServiceName "ContosoService"



This command creates a virtual machine configuration object by using the New-AzureVMConfig cmdlet. The command passes that object to the current cmdlet

by using the pipeline operator. The current cmdlet adds provisioning configuration for a virtual machine that runs the Windows operating system. The

configuration includes the administrator user name and password. The command passes the configuration to the New-AzureVM cmdlet, which creates the

virtual machine.

-------------------------- Example 2: Create a domain joined virtual machine --------------------------



PS C:\\>New-AzureVMConfig -Name "DomainVM" -InstanceSize Small -ImageName "Image09" | Add-AzureProvisioningConfig -WindowsDomain -Password "password"

-AdminUsername "AdminMain" -ResetPasswordOnFirstLogon -JoinDomain "contoso.com" -Domain "contoso" -DomainUserName "DomainAdminUser" -DomainPassword

"DomainPassword" -MachineObjectOU 'OU=AzureVMs,DC=contoso,DC=com' | New-AzureVM -ServiceName "ContosoService"



This command creates a virtual machine configuration object, and then passes it to the current cmdlet. The current cmdlet adds provisioning

configuration for a virtual machine to be joined with the contoso domain. The command includes user name and password necessary to join the virtual

machine to the domain. The configuration requires the user to change the user password at the first logon. The command creates the virtual machine based

on the provisioning object.

-------------------------- Example 3: Create a Linuxbased virtual machine --------------------------



PS C:\\>New-AzureVMConfig -Name "LinuxVM" -InstanceSize Small -ImageName "LinuxImage03" | Add-AzureProvisioningConfig -Linux -LinuxUser "LinuxRoot"

-Password "password" | New-AzureVM -ServiceName "ContosoService"



This command creates a virtual machine configuration object, and then passes it to the current cmdlet. The current cmdlet adds provisioning

configuration for a virtual machine that runs the Linux operating system. The configuration includes the root user name and password. The command

creates the virtual machine based on the provisioning object.

-------------------------- Example 4: Create a virtual machine that includes certificates for WinRM --------------------------



PS C:\\>$certs = Get-ChildItem Cert:\\CurrentUser\\My

New-AzureVMConfig -Name "NonDomainVM" -InstanceSize Small -ImageName "Image11" | Add-AzureProvisioningConfig -Windows -Password "password"

-AdminUsername "AdminMain" -WinRMCertificate $certs[0] -X509Certificates $certs[1], $certs[2] | New-AzureVM -ServiceName "ContosoService" -WaitForBoot



The first command gets certificates from a certificate store, and then stores them in the $certs array variable.

-------------------------- Example 5: Create a virtual machine that has WinRM enabled over HTTP --------------------------



PS C:\\>New-AzureVMConfig -Name "NonDomainVM" -InstanceSize Small -ImageName "Image14" | Add-AzureProvisioningConfig -Windows -Password "password"

-AdminUsername "AdminMain" -EnableWinRMHttp | New-AzureVM -ServiceName "ContosoService" -WaitForBoot



This command creates a virtual machine configuration object, and then passes it to the current cmdlet. The current cmdlet adds provisioning

configuration that has WinRM enabled over HTTP. The command creates the virtual machine based on the provisioning object.

-------------------------- Example 6: Create a virtual machine that has WinRM disabled over HTTPS --------------------------



PS C:\\>New-AzureVMConfig -Name "NonDomainVM" -InstanceSize Small -ImageName "Image07" | Add-AzureProvisioningConfig -Windows -Password "password"

-AdminUsername "AdminMain" -DisableWinRMHttps | New-AzureVM -ServiceName "ContosoService" -WaitForBoot



This command creates a virtual machine configuration object, and then passes it to the current cmdlet. The current cmdlet adds provisioning

configuration that disables WinRM over HTTPS. The command creates the virtual machine based on the provisioning object.

-------------------------- Example 7: Create a virtual machine with no key export --------------------------



PS C:\\>$certs = Get-ChildItem Cert:\\CurrentUser\\My

New-AzureVMConfig -Name "NonDomainVM" -InstanceSize Small -ImageName "Image07" | Add-AzureProvisioningConfig -Windows -Password "password"

-AdminUsername "AdminMain" -X509Certificates $certs[0], $certs[1] -NoExportPrivateKey | New-AzureVM -ServiceName "ContosoService" -WaitForBoot



The first command gets certificates from a certificate store, and then stores them in the $certs array variable.



RELATED LINKS

New-AzureVM

New-AzureVMConfig