Unregister-AzStackHCI

Unregister-AzStackHCI deletes the Microsoft.AzureStackHCI cloud resource representing the on-premises cluster and unregisters the on-premises cluster with Azure. The registered information available on the cluster is used to unregister the cluster if no parameters are passed.

Syntax

Unregister-AzStackHCI
          [[-SubscriptionId] <String>]
          [[-ResourceName] <String>]
          [[-TenantId] <String>]
          [[-ResourceGroupName] <String>]
          [[-ArmAccessToken] <String>]
          [[-AccountId] <String>]
          [[-EnvironmentName] <String>]
          [[-Region] <String>]
          [[-ComputerName] <String>]
          [-UseDeviceAuthentication]
          [-DisableOnlyAzureArcServer]
          [-IsWAC]
          [[-Credential] <PSCredential>]
          [-Force]
          [-WhatIf]
          [-Confirm]
          [<CommonParameters>]

Description

Unregister-AzStackHCI deletes the Microsoft.AzureStackHCI cloud resource representing the on-premises cluster and unregisters the on-premises cluster with Azure. The registered information available on the cluster is used to unregister the cluster if no parameters are passed.

Examples

Example 1:

Unregister-AzStackHCI

Result: Success

Invoking on one of the cluster node

Example 2:

Unregister-AzStackHCI -ComputerName ClusterNode1

Result: Success

Invoking from the management node

Example 3:

Unregister-AzStackHCI -SubscriptionId "12a0f531-56cb-4340-9501-257726d741fd" -ArmAccessToken etyer..ere= -AccountId user1@corp1.com -ResourceName DemoHCICluster3 -ResourceGroupName DemoHCIRG -Confirm:$False

Result: Success

Invoking from WAC

Example 4:

Unregister-AzStackHCI -SubscriptionId "12a0f531-56cb-4340-9501-257726d741fd" -ResourceName HciCluster1 -TenantId "c31c0dbb-ce27-4c78-ad26-a5f717c14557" -ResourceGroupName HciClusterRG -ArmAccessToken eerrer..ere= -AccountId user1@corp1.com -EnvironmentName AzureCloud -ComputerName node1hci -Credential Get-Credential

Result: Success

Invoking with all the parameters

Parameters

-AccountId

Specifies the AccoundId. Specifying this along with ArmAccessToken will avoid Azure interactive logon.

Type:String
Position:6
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ArmAccessToken

Specifies the ARM access token. Specifying this along with AccountId will avoid Azure interactive logon.

Type:String
Position:5
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ComputerName

Specifies one of the cluster node in on-premise cluster that is being registered to Azure.

Type:String
Position:9
Default value:None
Required:False
Accept pipeline input:False
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

-Credential

Specifies the credential for the ComputerName. Default is the current user executing the Cmdlet.

Type:PSCredential
Position:10
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableOnlyAzureArcServer

Specifying this parameter to $true will only unregister the cluster nodes with Arc for servers and Azure Stack HCI registration will not be altered.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnvironmentName

Specifies the Azure Environment. Default is AzureCloud. Valid values are AzureCloud, AzureChinaCloud, AzurePPE, AzureCanary, AzureUSGovernment

Type:String
Position:7
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Specifies that unregistration should continue even if we could not delete the Arc extensions on the nodes.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IsWAC

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Region

Specifies the Region the resource is created in Azure.

Type:String
Position:8
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Specifies the Azure Resource Group name. If not specified <LocalClusterName>-rg will be used as resource group name.

Type:String
Position:4
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceName

Specifies the resource name of the resource created in Azure. If not specified, on-premises cluster name is used.

Type:String
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

Specifies the Azure Subscription to create the resource

Type:String
Position:1
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TenantId

Specifies the Azure TenantId.

Type:String
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UseDeviceAuthentication

Use device code authentication instead of an interactive browser prompt.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
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

Outputs

PSCustomObject. Returns following Properties in PSCustomObject

Result: Success or Failed or Cancelled.