Depending on the turnover rate of organizations, there might be times when several employees leave at once, or you might do bulk cleanup of old accounts, kind of like a spring cleaning. With PowerShell, it's really easy and quite fast to disable Lync Users in one shot.
If you have the accounts already disabled in AD, this command will seek those out and disable their Lync accounts as well:
Get-CsAdUser | ?{$_.UserAccountControl -match "AccountDisabled" -and $_.Enabled -eq $true} | Disable-CsUser
If you have a certain OU for disabled accounts, you can run this command against that OU:
Get-CsUser -OU "OU=DisabledUsers,DC=YourDomain,DC=com" | Disable-CsUser
**Note** Change "OU=DisabledUsers,DC=YourDomain,DC=com" to the OU you want to run the command against change and "YourDomain" to reflect your environment.
Now you won't have to spend a ton of time disabling accounts one by one in the Lync Control Panel!
No comments:
Post a Comment