I recently received a request to create a security group that grants users remote access in emergency situations, but the user must be removed after 5 days. Originally we were using a PowerShell script that would save this information in a CSV file and update it every time it runs. Once the user is marked as being in the group for more than 5 days in the CSV file the user is removed from the group.
Now that I got my second request for an additional group I was thinking of using one of the Exchange custom multi value attributes (msExchExtensionCustomAttribute1) to store this information instead, but I can't figure out how to do so via PowerShell. I can add values to any of the 5 attributes for the security group in Active Directory Users and Computer, but can’t set them in PowerShell. I can do so for users using
Set-Mailbox John.Doe –ExtensionCustomAttribute1 $GROUPS
but it would be easier to store this info with the group and not the members of the group. Any ideas or can this not be done with groups?