Enable and disable Users Lync whith security Group


  • Hi 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}
    Tuesday, April 24, 2012 2:19 PM


  • 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 |

    Tuesday, April 24, 2012 2:30 PM