We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c4ce5c commit 548bdc5Copy full SHA for 548bdc5
1 file changed
private/functions/Update-SqlPermission.ps1
@@ -46,7 +46,11 @@ function Update-SqlPermission {
46
if ($SourceLogin.IsDisabled -ne $DestLogin.IsDisabled) {
47
if ($Pscmdlet.ShouldProcess($destination, "Setting login $newLoginName IsDisabled to $($SourceLogin.IsDisabled).")) {
48
try {
49
- $DestLogin.IsDisabled = $SourceLogin.IsDisabled
+ if ($SourceLogin.IsDisabled) {
50
+ $DestLogin.Disable()
51
+ } else {
52
+ $DestLogin.Enable()
53
+ }
54
$DestLogin.Alter()
55
Write-Message -Level Verbose -Message "Setting login $newLoginName IsDisabled to $($SourceLogin.IsDisabled) on $destination successfully performed."
56
} catch {
0 commit comments