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
 

Remove-AzureAccount

Remove-AzureAccount

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

Synopsis

Deletes an Azure account from Windows PowerShell.

Syntax

Remove-AzureAccount [-Name] [-Force] [-PassThru] [-SubscriptionDataFile] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

The Remove-AzureAccount cmdlet deletes an Azure account from your subscription data file and deletes the management certificate or access token that allows Windows PowerShell to access your account on your behalf. This cmdlet does not delete the account from Microsoft Azure, or change the actual account in any way.

Using this cmdlet is a lot like logging out of your Azure account. And, if you want to log into the account again, use the Add-AzureAccount or Import-AzurePublishSettingsFile to add the account to Windows PowerShell again.

You can also use Remove-AzureAccount cmdlet to change the way the Azure PowerShell cmdlets sign into your Azure account. If your account has both a management certificate from Import-AzurePublishSettingsFile and an access token from Add-AzureAccount, the Azure PowerShell cmdlets use only the access token; they ignore the management certificate. To use the management certificate, run Remove-AzureAccount. When Remove-AzureAccount finds both a management certificate and an access token, it deletes only the access token, instead of deleting the account. The management certificate is still there, so account is still available to Windows PowerShell.

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

-Force <SwitchParameter>

Suppresses the confirmation prompt. By default, Remove-AzureAccount prompts you before deleting the account from Windows PowerShell.

Aliases

None

Required?

false

Position

3

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-Name <String>

Specifies the name of the account to remove. The parameter value is case-sensitive. Wildcard characters are not supported.

Aliases

None

Required?

true

Position

1

Default value

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-PassThru <SwitchParameter>

Returns True ($true) if the operation succeeded and False ($false) if it failed. By default, the cmdlet does not return any output.

Aliases

None

Required?

false

Position

4

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

-Confirm <SwitchParameter>

Prompts you for confirmation before running the cmdlet.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

-WhatIf <SwitchParameter>

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

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type

None

Return Type

None or System.Boolean

Notes

None

Examples

Example 1: Delete an account

This command deletes the admin@contoso.com from your subscription data file. When the command completes, the account is no longer available to Windows PowerShell.

PS C:\>Remove-AzureAccount -Name admin@contoso.com

Online Version
Add-AzureAccount
Get-AzureAccount