Sync Service - Forward Sync Rule to Clear UTCTime Virtual Attribute

Hey Everyone,

I cant seem to get the right syntax down in a powershell Forward Sync Rule in our Sync Service to clear a UTCTime VA

Right now we are having to set it to way in the future like this

$srcLastAccessDate = $srcObj["LastAccessDate"]
$dstLeaveDate = $dstObj["edsvaACLeaveDate"]
$LastAccessDate = ""

# Check if LeaveDate is populated in feed file
If (($srcLastAccessDate -eq "") -or ($srcLastAccessDate -eq $null)) {

    # LeaveDate is emty in feed, check to see if dest is populated, if so then set to 2099
    if (!( ($dstLeaveDate -eq "") -or ($dstLeaveDate -eq $null) )) {
        $tmp = "2099-12-31"
        $LastAccessDate = $tmp.ToDateTime($Null)
    }
    else {
        return
    }
}
else {
    #not empty
    $LastAccessDate = $srcLastAccessDate.ToDateTime($Null)
}

$LastAccessDate

Right now we are having to set it to the future and cleaning them up later in cmdline.

We tried all ways to clear it within the sync engine but things that work in cmdline didn't work in the sync rule.

Any ideas?

Thanks ,

Clay

Parents
  • I seem to have been able to do this by issuing "return $null" inside the second nested If block, in place of the two lines of code that are there now. If the source feed no longer has a value in the LastAccessDate column for a user but that user does have a value in the VA, then the "return $null" is clearing the value stored in the VA.

Reply
  • I seem to have been able to do this by issuing "return $null" inside the second nested If block, in place of the two lines of code that are there now. If the source feed no longer has a value in the LastAccessDate column for a user but that user does have a value in the VA, then the "return $null" is clearing the value stored in the VA.

Children