Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Remove-AzSqlInstanceActiveDirectoryAdministrator
- Module:
- Az.Sql Module
Removes a Microsoft Entra administrator for SQL Managed Instance.
Syntax
UseResourceGroupAndInstanceNameParameterSet (Default)
Remove-AzSqlInstanceActiveDirectoryAdministrator
[-ResourceGroupName] <String>
[-InstanceName] <String>
[-Force]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
UseInputObjectParameterSet
Remove-AzSqlInstanceActiveDirectoryAdministrator
-InputObject <AzureSqlManagedInstanceModel>
[-Force]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
UserResourceIdParameterSet
Remove-AzSqlInstanceActiveDirectoryAdministrator
[-ResourceId] <String>
[-Force]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-AzSqlInstanceActiveDirectoryAdministrator cmdlet removes a Microsoft Entra administrator for AzureSQL Managed Instance in the current subscription.
Examples
Example 1: Remove an administrator
Remove-AzSqlInstanceActiveDirectoryAdministrator -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstanceName01" -Confirm -PassThru
Are you sure you want to remove the Azure Sql Instance Active Directory Administrator on managed instance 'ManagedInstanceName01'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
ResourceGroupName InstanceName DisplayName ObjectId
----------------- --------------------- ----------- --------
ResourceGroup01 ManagedInstanceName01 DBAs 40b79501-b343-44ed-9ce7-da4c8cc7353b
This command removes the Microsoft Entra administrator for the managed instance named ManagedInstanceName01 associated with the resource group ResourceGroup01.
Example 2
Get-AzSqlInstance -ResourceGroupName "ResourceGroup01" -Name "ManagedInstance1" | Remove-AzSqlInstanceActiveDirectoryAdministrator -Confirm -PassThru
Are you sure you want to remove the Azure Sql Instance Active Directory Administrator on managed instance 'ManagedInstanceName01'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
ResourceGroupName InstanceName DisplayName ObjectId
----------------- --------------------- ----------- --------
ResourceGroup01 ManagedInstanceName01 DBAs 40b79501-b343-44ed-9ce7-da4c8cc7353b
This command removes the Microsoft Entra administrator from the managed instance object.
Example 3
Get-AzSqlInstance -ResourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance1" | Remove-AzSqlInstanceActiveDirectoryAdministrator -Confirm -PassThru
Are you sure you want to remove the Azure Sql Instance Active Directory Administrator on managed instance 'ManagedInstanceName01'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
ResourceGroupName InstanceName DisplayName ObjectId
----------------- --------------------- ----------- --------
ResourceGroup01 ManagedInstanceName01 DBAs 40b79501-b343-44ed-9ce7-da4c8cc7353b
This command removes the Microsoft Entra administrator using managed instance resource identifier.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-Force
Skip confirmation message for performing the action
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-InputObject
The managed instance object to use.
Parameter properties
| Type: | AzureSqlManagedInstanceModel |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-InstanceName
SQL Managed Instance name.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PassThru
Defines whether to return the removed AD administrator
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceGroupName
The name of the resource group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceId
The resource id of instance to use
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
String
Outputs
AzureSqlInstanceActiveDirectoryAdministratorModel
Related Links
Azure PowerShell
Feedback
Was this page helpful?
