Set-AzSqlServer
Modifies properties of a SQL Database server.
Syntax
Set-AzSqlServer
[-ServerName] <String>
[-SqlAdministratorPassword <SecureString>]
[-Tags <Hashtable>]
[-ServerVersion <String>]
[-AssignIdentity]
[-PublicNetworkAccess <String>]
[-MinimalTlsVersion <String>]
[-Force]
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-AzSqlServer cmdlet modifies properties of an Azure SQL Database server.
Examples
Example 1: Reset the administrator password
PS C:\>$ServerPassword = "newpassword"
PS C:\> $SecureString = ConvertTo-SecureString $ServerPassword -AsPlainText -Force
PS C:\> Set-AzSqlServer -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.
Example 2
Modifies properties of a SQL Database server. (autogenerated)
Set-AzSqlServer -AssignIdentity -ResourceGroupName 'ResourceGroup01' -ServerName 'Server01'
Parameters
Generate and assign an Azure Active Directory Identity for this server for use with key management services like Azure KeyVault.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure
Type: | Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Forces the command to run without asking for user confirmation.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The minimal TLS version to enforce for Sql Server
Type: | String |
Accepted values: | 1.0, 1.1, 1.2 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Takes a flag, enabled/disabled, to specify whether public network access to server is allowed or not. When disabled, only connections made through Private Links can reach this server.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the resource group to which the server is assigned.
Type: | String |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the name of the server that this cmdlet modifies.
Type: | String |
Aliases: | Name |
Position: | 1 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the version to which this cmdlet changes the server. The acceptable values for this parameter are: 2.0 and 12.0.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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
.
Type: | SecureString |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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"}
Type: | Hashtable |
Aliases: | Tag |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |