Remove-sqmAdOrphanLogin
Examples
Remove-sqmAdOrphanLogin -SqlInstance "SQL01" -WhatIf
Remove-sqmAdOrphanLogin -SqlInstance "SQL01" -WhatIf
Lists exactly which AD-orphaned logins would be removed, without changing anything.
Remove-sqmAdOrphanLogin -SqlInstance "SQL01"
Remove-sqmAdOrphanLogin -SqlInstance "SQL01"
Removes confirmed AD-orphaned logins after a rollback backup, asking for confirmation per login.
Remove-sqmAdOrphanLogin -SqlInstance "SQL01" -ExcludeLogin 'DOMAIN\KeepThis*' -Confirm:$false
Remove-sqmAdOrphanLogin -SqlInstance "SQL01" -ExcludeLogin 'DOMAIN\KeepThis*' -Confirm:$false
Removes confirmed orphans (except the excluded pattern) without interactive confirmation.