New-AzDataMigrationLoginsMigration
Migrate logins from the source Sql Servers to the target Azure Sql Servers.
Syntax
ConfigFile (Default)
New-AzDataMigrationLoginsMigration
-ConfigFilePath <String>
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CommandLine
New-AzDataMigrationLoginsMigration
-SourceSqlConnectionString <String[]>
-TargetSqlConnectionString <String>
[-CSVFilePath <String>]
[-ListOfLogin <String[]>]
[-OutputFolder <String>]
[-AADDomainName <String>]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Migrate logins from the source Sql Servers to the target Azure Sql Servers.
Examples
Example 1: Run Migrate logins from the source Sql Servers to the target Azure Sql Servers using Parameters
New-AzDataMigrationLoginsMigration -SourceSqlConnectionString "data source=servername;user id=userid;password=;initial catalog=master;TrustServerCertificate=True" -TargetSqlConnectionString "data source=servername;user id=userid;password=;initial catalog=master;TrustServerCertificate=True" -CSVFilePath "C:\CSVFile" -ListOfLogin "loginname1" "loginname2" -OutputFolder "C:\OutputFolder" -AADDomainName "AADDomainName"
Starting Logins migration...
Starting server roles migration...
Starting user-login mappings...
Starting server role mappings...
Restoring permissions for logins...
Restoring permissions for server roles...
Login migration process complete.
This command runs Run SKU Recommendation on given SQL Server using the connection string.
Example 2: Run Migrate logins from the source Sql Servers to the target Azure Sql Servers using config file
New-AzDataMigrationLoginsMigration -ConfigFilePath "C:\Users\user\document\config.json"
Starting Logins migration...
Starting server roles migration...
Starting user-login mappings...
Starting server role mappings...
Restoring permissions for logins...
Restoring permissions for server roles...
Login migration process complete.
This command runs Run Migrate logins from the source Sql Servers to the target Azure Sql Servers using config file.
Parameters
-AADDomainName
Optional.
Required if Windows logins are included in the list of logins to be migrated.
(Default: empty string).
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CommandLine
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ConfigFilePath
Path of the ConfigFile
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ConfigFile
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-CSVFilePath
Optional.
Location of CSV file of logins.
Use only one parameter between this and listOfLogin.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CommandLine
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ListOfLogin
Optional.
List of logins in string format.
If large number of logins need to be migrated, use CSV file option.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CommandLine
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-OutputFolder
Optional.
Default: %LocalAppData%/Microsoft/SqlLoginMigrations) Folder where logs will be written.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CommandLine
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-PassThru
Migrate logins from the source Sql Servers to the target Azure Sql Servers.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-SourceSqlConnectionString
Required.
Connection string(s) for the source SQL instance(s), using the formal connection string format.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CommandLine
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TargetSqlConnectionString
Required.
Connection string(s) for the target SQL instance(s), using the formal connection string format.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CommandLine
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
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 .
Outputs