How to get a Temporal End Date when new member added to a group

I have a script that will set a temporal end date to 1 year from that date for certains groups when no date is entered.  What I am struggling to find is a way to grab the end date if one is entered.  We do not want anyone to put someone in a Group for longer than a certain period (we have a few like 1 week. 2 weeks or a year).  Is there a way to grab that date so I can use a script to check when a group member is added?  I use the below for after they are in the group but i'm not having any luck in using this on the PostModify in my policy.  It keeps returning no date. 

Script in Policy that does not return the

    $group = $request.GUID

    $member = $request.getex("member")

$EndTime = "edsva-ScheduledLink-EndTime"  
$DateEntered = Get-QADGroupMember -Identity $group -Proxy -Control @{'ScheduledLink-GetStartEndTime'=1} -IncludedProperties  $EndTime | where {($_.dn) -eq $member} | Select-Object $EndTime
    

If I run the above for a group and user with a temporal end date I get data back.  But as I said if it's run from the postmodify group portion of a policy script the $DateEntered comes back blank.  Is it because it's not committed yet so it can't look it up?  Is there a way to grab it with a $request.xxxx ?

Parents Reply Children
No Data