Created
September 8, 2020 18:13
-
-
Save alevyinroc/6c72c72172127c4474ee52cbe9d4c54f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$RestoreResult = Restore-DbaDatabase -SqlInstance $DstInstance -Database $DBName -Path $Sql17Backup.FullName -WithReplace; | |
Write-Output "Users in $DstInstance.$DBName before correcting"; | |
Get-DbaDbUser -sqlinstance $DstInstance -Database $DBName | format-table -autosize -Property SqlInstance, Database, Name, Login; | |
Write-Output "Orphan users in $DstInstance.$DBName before correcting"; | |
Get-DbaDbOrphanUser -sqlinstance $DstInstance -Database $DBName | format-table -autosize -property SqlInstance, DatabaseName, User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment