< Back

Set-AzureRmSqlServer

Tue Jan 29, 2019 10:10 pm

NAME Set-AzureRmSqlServer



SYNOPSIS

Modifies properties of a SQL Database server.





SYNTAX

Set-AzureRmSqlServer [-ResourceGroupName] <String> [-ServerName] <String> [-AssignIdentity] [-DefaultProfile <IAzureContextContainer>] [-Force]

[-ServerVersion <String>] [-SqlAdministratorPassword <SecureString>] [-Tags <Hashtable>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Set-AzureRmSqlServer cmdlet modifies properties of an Azure SQL Database server.





PARAMETERS

-AssignIdentity [<SwitchParameter>]

Generate and assign an Azure Active Directory Identity for this server for use with key management services like Azure KeyVault.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-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



-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

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 server that this cmdlet modifies.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ServerVersion <String>

Specifies the version to which this cmdlet changes the server. The acceptable values for this parameter are: 2.0 and 12.0.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SqlAdministratorPassword <SecureString>

Specifies a new password, as a SecureString , for the database server administrator. To obtain a SecureString , use the Get-Credential cmdlet.

For more information, type `Get-Help ConvertTo-SecureString`.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Tags <Hashtable>

Specifies a dictionary of tags that this cmdlet associates with the server. Key-value pairs in the form of a hash table set as tags on the

server. For example:



@{key0="value0";key1=$null;key2="value2"}



Required? false

Position? named

Default value None

Accept pipeline input? False

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.Server.Model.AzureSqlServerModel







NOTES









Example 1: Reset the administrator password



PS C:\\>$ServerPassword = "newpassword"

PS C:\\> $SecureString = ConvertTo-SecureString $ServerPassword -AsPlainText -Force

PS C:\\> Set-AzureRmSqlServer -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -SqlAdministratorPassword $secureString

ResourceGroupName : ResourceGroup01

ServerName : Server01

Location : Australia East

SqlAdministratorLogin : adminLogin

SqlAdministratorPassword :

ServerVersion : 12.0

Tags :

Identity :

FullyQualifiedDomainName : server01.database.windows.net



This command resets the administrator password on the AzureSQL Server named server01.







RELATED LINKS

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

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