< Back

Set-AzureRmSqlServerActiveDirectoryAdministrator

Tue Jan 29, 2019 10:10 pm

NAME Set-AzureRmSqlServerActiveDirectoryAdministrator



SYNOPSIS

Provisions an Azure AD administrator for SQL Server.





SYNTAX

Set-AzureRmSqlServerActiveDirectoryAdministrator [-ResourceGroupName] <String> [-ServerName] <String> [-DisplayName] <String> [[-ObjectId] <Guid>]

[-DefaultProfile <IAzureContextContainer>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Set-AzureRmSqlServerActiveDirectoryAdministrator cmdlet provisions an Azure Active Directory (Azure AD) administrator for AzureSQL Server in

the current subscription.



You can provision only one administrator at a time.



The following members of Azure AD can be provisioned as a SQL Server administrator:



- Native members of Azure AD



- Federated members of Azure AD



- Imported members from other Azure ADs who are native or federated members



- Azure AD groups created as security groups





Microsoft accounts, such as those in the Outlook.com, Hotmail.com, or Live.com domains, are not supported as administrators. Other guest accounts,

such as those in the Gmail.com or Yahoo.com domains, are not supported as administrators.

We recommend that you provision a dedicated Azure AD group as an administrator.







PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DisplayName <String>

Specifies the display name of the Azure AD administrator that this cmdlet provisions.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ObjectId <Guid>

Specifies the unique ID of the Azure AD administrator that this cmdlet provisions. If the display name is not unique, you must specify a value

for this parameter.



Required? false

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group to which the server is assigned.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ServerName <String>

Specifies the name of the SQL Server for which this cmdlet provisions an administrator.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



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.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Sql.ServerActiveDirectoryAdministrator.Model.AzureSqlServerActiveDirectoryAdministratorModel







NOTES









Example 1: Provision an administrator group for a server



PS C:\\>Set-AzureRmSqlServerActiveDirectoryAdministrator -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DisplayName "DBAs"

ResourceGroupName ServerName DisplayName ObjectId

----------------- ---------- ----------- --------

ResourceGroup01 Server01 DBAs 40b79501-b343-44ed-9ce7-da4c8cc7353b



This command provisions an Azure AD administrator group named DBAs for the server named Server01. This server is associated with resource group

ResourceGroup01.





Example 2: Provision an administrator user for a server



PS C:\\>Set-AzureRmSqlServerActiveDirectoryAdministrator -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DisplayName "David Chew"

ResourceGroupName ServerName DisplayName ObjectId

----------------- ---------- ----------- --------

resourcegroup01 server01 David Chew 11E95548-B179-4FE1-9AF4-ACA49D13ABB9



This command provisions an Azure AD user as an administrator for the server named Server01.





Example 3: Provision an administrator group by specifying its ID



PS C:\\>Set-AzureRmSqlServerActiveDirectoryAdministrator -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DisplayName "DBAs" -ObjectId

"40b79501-b343-44ed-9ce7-da4c8cc7353b"

ResourceGroupName ServerName DisplayName ObjectId

----------------- ---------- ----------- --------

ResourceGroup01 Server01 DBAs 40b79501-b343-44ed-9ce7-da4c8cc7353b



This command provisions an Azure AD administrator group named DBAs for the server named Server01. The command specifies an ID for the ObjectId

parameter. This makes sure that that the command succeeds even if the display name of the group is not unique.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... inistrator

Get-AzureRmSqlServerActiveDirectoryAdministrator

Remove-AzureRmSqlServerActiveDirectoryAdministrator

SQL Database Documentation https://docs.microsoft.com/azure/sql-database/