This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Workflow to add a user to an Admin group, then automatically remove them in X days.

    Management has asked that we limit the time a user is a member of the Enterprise Admins group.  I am copying a workflow that we use for approval of membership in the Domain Admins group, however I see no way to add a time component to the workflow.  Is there any way a workflow triggered from an AD action can grant temporary group access?

Parents
  • This is what I will add to the workflow:

    function onPostModify($Request)
    {
    $groupDN = $workflow.Parameter('groupDN') #get the group DN from the workflow
    $member = $workflow.Parameter('memberDN') #get the member from the workflow
    $days = 5 #days to schedule the removal
    $time = (Get-Date).AddDays($days).ToUniversalTime()
    $hash = @{}
    $hash.add("ScheduledOperation-SetTime",$time)
    Remove-QADGroupMember -Identity $groupDN -Member $member -Control $hash


    }
Reply
  • This is what I will add to the workflow:

    function onPostModify($Request)
    {
    $groupDN = $workflow.Parameter('groupDN') #get the group DN from the workflow
    $member = $workflow.Parameter('memberDN') #get the member from the workflow
    $days = 5 #days to schedule the removal
    $time = (Get-Date).AddDays($days).ToUniversalTime()
    $hash = @{}
    $hash.add("ScheduledOperation-SetTime",$time)
    Remove-QADGroupMember -Identity $groupDN -Member $member -Control $hash


    }
Children
No Data