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
  • You could also consider going into the Schema within the source connection's Connection Settings and editing the Attribute Type for that column to DateTime. I tested this as an alternate approach and didn't need any PowerShell code to handle the setting/clearing of the DateTime values. That Forward Sync Rule will just be a standard Attribute to Attribute mapping.

Reply
  • You could also consider going into the Schema within the source connection's Connection Settings and editing the Attribute Type for that column to DateTime. I tested this as an alternate approach and didn't need any PowerShell code to handle the setting/clearing of the DateTime values. That Forward Sync Rule will just be a standard Attribute to Attribute mapping.

Children
No Data