Is it possible to script having users added (or removed) from a Security Group based on another AD Attribute?
I have found ways to do this in Powershell (something like):
# Get the ad cmdlets imported
import-module ActiveDirectory
# Clear all current members of NoInternet Group
get-adgroupmember No_Internet_GG | %{remove-adgroupmember No_Internet_GG $_.SamAccountName -Confirm:$false}
# Add all No Internet users to a Group
get-aduser -filter{city -like "No Internetville"} | %{Add-ADGroupMember No_Internet_GG $_.SamAccountName}
but I wanted to see if this is possible with an Adaxes script.
For instance, if a user has a location AD attribute of CA, I want them added to the LOCATION_CA AD security group. If they relocate to CO, I want them to be removed from the LOCATION_CA group and added to the LOCATION_CO group. The script would then run in a timed fashion, weekly. Alternatively, the script could just delete all members of the LOCATION_CA group on a weekly basis and then re-populate it based on the location AD attribute.
Or should I just utilize the PS script and just run it through Adaxes on a timed fashion?
Thanks!