Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $server="WIN-SH7H3HP7KMISQL2014"
- $User="bilal"
- $password="test"
- if(!($svr.Logins.Contains($User)))
- {
- $login = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Login -ArgumentList $server, $User
- $login.LoginType = [Microsoft.SqlServer.Management.Smo.LoginType]::SqlLogin
- $login.PasswordExpirationEnabled = $false
- $login.Create($password)
- Write-Host("Login $loginName created successfully.")
- }
- $server="WIN-SH7H3HP7KMISQL2014"
- $User="bilal"
- $password="test"
- if(!($svr.Logins.Contains($User)))
- {
- $login = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Login -ArgumentList $server, $User
- $login.LoginType = [Microsoft.SqlServer.Management.Smo.LoginType]::SqlLogin
- $login.PasswordExpirationEnabled = $false
- $login.Create($password)
- Write-Host("Login $loginName created successfully.")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement