Hi guys,
Please , i would like to create an interactive script that adds a user to a group in AD, for a temporary period.
so far, it’s ok, but I want to add a control on the maximum possible duration (5 days for example ), and If you enter a maximum of 5 days, you send a message (duration too long! you need a number less than 5 for example).
And another control which will send an email to inform that such user has been added to AD group “x”.
this is the script :
Add-ADGroupMember -Identity “Direction” -Members “Florian” -MemberTimeToLive (New-TimeSpan -Days 2)
Thank you for your answers,
Good day,