Enable and disable Users Lync whith security Group
-
Tuesday, April 24, 2012 2:19 PMHi folks, I'm working with and trying lync server automatically perform user load and removal of users through active directory group called: EnableLyncUsers. This part of code works well, runs the group "enablelyncusers" and goes on the server enabling lync. as I can do to make if I delete a team member in the serverlync delete it?
Add-PSSnapin Quest.ActiveRoles.ADManagement
import-module lync
Get-QADGroupMember 'EnableLyncUsers'-sizelimit 0-Type 'user'-Indirect | foreach {Enable-csuser-identity-RegistrarPool $ _.samAccountName myserverpool-SipAddressType samAccountName-SipDomain mydomain.local}
All Replies
-
Tuesday, April 24, 2012 2:30 PMModerator
There are two ways to do this:
1. Create an output file for the current and previous runs of the script and then run the enable/disable operation against the changes between the two files.
2. Parse the enabled users on each run and ensure they are in the group. Run a disable operation against any user who is not in the group.
The first way would be more efficient.
Mike Stacy | http://mikestacy.typepad.com
- Proposed As Answer by Sean_XiaoMicrosoft Contingent Staff, Moderator Monday, April 30, 2012 6:32 AM
- Marked As Answer by Sean_XiaoMicrosoft Contingent Staff, Moderator Tuesday, May 01, 2012 7:28 AM

