New-DbaLogin,dbatools
The below command will create an SQL Server authentication login on both the servers at a time. Once you run the command a pop window ask for password, then provide the password.
cls
New-DbaLogin `
-SqlInstance SERVER1,SERVER2 `
-Login LoginNameHere -Verbose
#Handling Windows login. The main thing we #need to remember here is DOMAIN name. cls New-DbaLogin ` -SqlInstance Server1 ` -Login DomainName\Login1,DomainName\Login2 -Verbose
Comments