Compartilhar via


Add-AzureProvisioningConfig

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Add-AzureProvisioningConfig

Adds the provisioning configuration to an Azure virtual machine.

Syntax

Parameter Set: Windows
Add-AzureProvisioningConfig -VM <IPersistentVM> -Windows [-AdminUsername <String> ] [-Certificates <CertificateSettingList> ] [-CustomDataFile <String> ] [-DisableAutomaticUpdates] [-DisableGuestAgent] [-DisableWinRMHttps] [-EnableWinRMHttp] [-NoExportPrivateKey] [-NoRDPEndpoint] [-NoWinRMEndpoint] [-Password <String> ] [-ResetPasswordOnFirstLogon] [-TimeZone <String> ] [-WinRMCertificate <X509Certificate2> ] [-X509Certificates <X509Certificate2[]> ] [ <CommonParameters>]

Parameter Set: Linux
Add-AzureProvisioningConfig -Linux -VM <IPersistentVM> [-CustomDataFile <String> ] [-DisableGuestAgent] [-DisableSSH] [-LinuxUser <String> ] [-NoSSHEndpoint] [-NoSSHPassword] [-Password <String> ] [-SSHKeyPairs <SSHKeyPairList> ] [-SSHPublicKeys <SSHPublicKeyList> ] [ <CommonParameters>]

Parameter Set: WindowsDomain
Add-AzureProvisioningConfig -AdminUsername <String> -Domain <String> -DomainPassword <String> -DomainUserName <String> -JoinDomain <String> -VM <IPersistentVM> -WindowsDomain [-Certificates <CertificateSettingList> ] [-CustomDataFile <String> ] [-DisableAutomaticUpdates] [-DisableGuestAgent] [-DisableWinRMHttps] [-EnableWinRMHttp] [-MachineObjectOU <String> ] [-NoExportPrivateKey] [-NoRDPEndpoint] [-NoWinRMEndpoint] [-Password <String> ] [-ResetPasswordOnFirstLogon] [-TimeZone <String> ] [-WinRMCertificate <X509Certificate2> ] [-X509Certificates <X509Certificate2[]> ] [ <CommonParameters>]

Detailed Description

This topic describes the cmdlet in the 0.8.10 version of the Microsoft Azure PowerShell module. To get the version of the module you're using, in the Azure PowerShell console, type (Get-Module -Name Azure).Version.

The Add-AzureProvisioningConfig cmdlet adds configuration information to a virtual machine configuration used to create a new virtual machine.

Different provisioning configurations are supported, including standalone Windows servers, Windows servers joined to an Active Directory domain, and Linux-based servers.

When you create an Active Directory domain-joined server, the provisioning configuration must specify the fully qualified domain name of the Active Directory domain, as well as the domain credentials of a user with permission to join the computer to the domain.

Parameters

-AdminUsername<String>

Specifies the name for the user account to create for administrative access to the virtual machine.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Certificates<CertificateSettingList>

Specifies a set of certificates to install in the virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CustomDataFile<String>

Specifies the name of a data file. This cmdlet base-64 encodes the contents of the file and sends it with the provisioning configuration information. The file must be less than 64KB or the Azure API will not accept the request. On Windows, this data ends up in %SYSTEMDRIVE%\AzureData\CustomData.bin as a binary file. On Linux, this data is passed to the virtual machine by means of the ovf-env.xml file, which is copied to the /var/lib/waagent directory during provisioning. The agent also places the base-64 encoded data in /var/lib/waagent/CustomData during provisioning.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DisableAutomaticUpdates

If specified, the configuration is created with automatic updates disabled.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DisableGuestAgent

Indicates that this cmdlet disables the IaaS provision guest agent.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DisableSSH

If specified, the virtual machine is created with SSH disabled.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DisableWinRMHttps

Disables Windows Remote Management (WinRM) on http, which is added by default.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Domain<String>

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

Aliases

none

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.

Aliases

none

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.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableWinRMHttp

Enables Windows Remote Management (WinRM) over http.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JoinDomain<String>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Linux

Specify to create a Linux provisioning configuration.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LinuxUser<String>

Specifies the Linux administrative account name to create.

Aliases

none

Required?

false

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 computer account is created.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NoExportPrivateKey

If specified, prevents the private key from being uploaded.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NoRDPEndpoint

If specified, creates the virtual machine without a Remote Desktop endpoint.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NoSSHEndpoint

If specified, creates the virtual machine without an SSH endpoint.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NoSSHPassword

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NoWinRMEndpoint

Indicates that this cmdlet prevents the WinRM endpoint from being added.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Password<String>

Specifies the password of the administrative account for the virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ResetPasswordOnFirstLogon

If specified, forces the user to change the password on first logon.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SSHKeyPairs<SSHKeyPairList>

Specifies a list of SSH key pairs already deployed in the subscription to deploy in the virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SSHPublicKeys<SSHPublicKeyList>

Specifies a list of SSH public keys already deployed in the subscription to deploy in the virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TimeZone<String>

Specifies the Microsoft Time Zone value to use to set the time zone for the virtual machine. Examples are: "Pacific Standard Time" and "Canada Central Standard Time".

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VM<IPersistentVM>

Specifies the virtual machine object.

Aliases

InputObject

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Windows

Specify to create a Windows provisioning configuration that is not joined to a domain.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WindowsDomain

Specify to create a provisioning configuration for a Windows server joined to an Active Directory domain.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WinRMCertificate<X509Certificate2>

Specifies a certificate that will be associated with an endpoint for Windows Remote Management (WinRM).

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-X509Certificates<X509Certificate2[]>

Specifies an X509 certificate that will be associated with an endpoint for Windows Remote Management (WinRM).

Aliases

none

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.

Examples

Example 1

This example creates a new Windows virtual machine and adds it to the specified service.

C:\PS> New-AzureVMConfig -Name "MyNonDomainVM" -InstanceSize Small -ImageName $img `
 | Add-AzureProvisioningConfig -Windows –Password $Password `
 | New-AzureVM -ServiceName $svcName

Example 2

This example creates a new, domain-joined Windows virtual machine and adds it to the specified service.

C:\PS> New-AzureVMConfig -Name "MyDomainVM" -InstanceSize Small -ImageName $img `
 | Add-AzureProvisioningConfig -WindowsDomain –Password $Password -ResetPasswordOnFirstLogon -JoinDomain "contoso.com" -Domain "contoso" -DomainUserName "domainadminuser" -DomainPassword "domainPassword" -MachineObjectOU 'OU=AzureVMs,DC=contoso,DC=com'
 | New-AzureVM -ServiceName $svcName

Example 3

This example creates a new Linux virtual machine and adds it to the specified service.

C:\PS> New-AzureVMConfig -Name "MyLinuxVM" -InstanceSize Small -ImageName $LnxImg `
 | Add-AzureProvisioningConfig -Linux -LinuxUser $linuxUser –Password $Password `
 | New-AzureVM -ServiceName $svcName

New-AzureVMConfig

New-AzureVM