Update AD Group Using AD Users’ Title

Usually in most organizations admins creates a security groups which they are using for granting access to shares, folders, SharePoint resources. I am using these two strings to update current security group. It is possible to copy these strings and replace the name of the group, put all these strings to one script and create a task for running it periodically.

Get-QADGroupMember -Identity "Head_of_Departments" | foreach {Remove-QADGroupMember -Identity "Head_of_Departments" -Member $_.sid}
Get-QADUser -title "Head of*Department" -enabled | foreach {Add-QADGroupMember -Identity "Head_of_Departments" -Member $_.sid}

P.S. I am using:

  • $Host.Version 2.0
  • Quest.ActiveRoles.ADManagement 1.4.0.2139
bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark
tabs-top

Leave a Reply