Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureAccount

Get-AzureAccount

microsoft.windowsazure.commands.dll, microsoft.windowsazure.commands.profile.dll

Synopsis

Gets Azure accounts that are available to Azure PowerShell.

Syntax

Get-AzureAccount [-Name] [-SubscriptionDataFile] [<CommonParameters>]

Detailed Description

The Get-AzureAccount cmdlet gets the Azure accounts that are available to Windows PowerShell. To make your accounts available to Windows PowerShell, run the Add-AzureAccount or Import-PublishSettingsFile cmdlets.

The Get-AzureEnvironment cmdlet gets environments from your subscription data file, not from Azure. If the subscription data file is outdated, run the Add-AzureAccount or Import-PublishSettingsFile cmdlets to refresh it.This topic describes the cmdlet in the .7.2 version of the Microsoft Azure PowerShell module. To find out the version of the module you're using, from the Azure PowerShell console, type (get-module azure).version.

Parameters

-Name <String>

Gets only the specified account. Type the account name. The Name value is case-sensitive. Wildcards are not permitted. The default is all accounts that are available to Windows PowerShell.

Aliases

None

Required?

false

Position

1

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-SubscriptionDataFile <String>

Specifies the path and filename of an alternate subscription data file. This parameter is optional. By default, Get-AzureAccount gets account and subscription information from the default subscription data file in your roaming user profile. Use this parameter if you used the SubscriptionDataFile parameter in Add-AzureAccount or Import-AzurePublishSettingsFile to specify an alternate (non-default) file.

Aliases

None

Required?

false

Position

named

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type

None

Return Type

None

Notes

None

Examples

Example 1: Get all accounts

This command gets all accounts associated with the specified user.

PS C:\>Get-AzureAccount
Name                         ActiveDirectories
----                         -----------------
contosoadmin@outlook.com     {{ ActiveDirectoryTenantId = abcde5cd-bcc3-441a-bd86-e6a...
contosotest1@outlook.com     {{ ActiveDirectoryTenantId = aaeabcde-386c-4466-bf70-794...

Example 2: Get an account by name

This command gets the ContosoAdmin account.

PS C:\>Get-AzureAccount -Name contosoadmin@outlook.com
Name                         ActiveDirectories
----                         -----------------
contosoadmin@outlook.com     {{ ActiveDirectoryTenantId = abcde5cd-bcc3-441a-bd86-e6a...

Online Version
Add-AzureAccount
Remove-AzureAccount
Get-AzurePublishSettingsFile
Import-AzurePublishSettingsFile