0
Answered

Entities not created on Polling import

Carol Wapshere 7 years ago in PowerShell connector updated by Curtis Lusmore 7 years ago 3

I am developing a Powershell connector. It uses exactly the same script for Full and Polling imports, just with a "-RunType Delta" switch for polling. The difference is all about how it detects how many users to look at - once it gets to creating the IdB entities the script is identical.

I have four new objects in the external system. They are correctly identified by the script on a Polling import, however the new entities are not created in IdB. When I run a Full import the entities are created. (I have done searches to confirm this)

The following log excerpt shows the four entities that should be created, but the changes reported are 0:

20171211,04:47:22,UNIFY Identity Broker,Logging,Information,Exchange Protected Import: Creating 4 entities,Normal
20171211,04:47:23,UNIFY Identity Broker,Logging,Information,"
Key   : DN
Value : CN=Supressed1\, Changed1,OU=ACT,OU=Users,OU=Accounts,OU=DEV,DC=domain
Key   : PersonNumber
Value : 20523
Key   : TerminationAutoReply
Value : False
Key   : Status
Value : ACTIVE
Key   : HiddenFromGAL
Value : False
",Normal
20171211,04:47:23,UNIFY Identity Broker,Logging,Information,"
Key   : DN
Value : CN=Supressed2\, Changed2,OU=ACT,OU=Users,OU=Accounts,OU=DEV,DC=domain
Key   : PersonNumber
Value : 11831
Key   : TerminationAutoReply
Value : False
Key   : Status
Value : ACTIVE
Key   : HiddenFromGAL
Value : False
",Normal
20171211,04:47:23,UNIFY Identity Broker,Logging,Information,"
Key   : DN
Value : CN=Supressed3\, Changed3,OU=ACT,OU=Users,OU=Accounts,OU=DEV,DC=domain
Key   : PersonNumber
Value : 73564915
Key   : TerminationAutoReply
Value : False
Key   : Status
Value : ACTIVE
Key   : HiddenFromGAL
Value : False
",Normal
20171211,04:47:23,UNIFY Identity Broker,Logging,Information,"
Key   : DN
Value : CN=Supressed4\, Changed4,OU=ACT,OU=Users,OU=Accounts,OU=DEV,DC=domain
Key   : PersonNumber
Value : 18582
Key   : TerminationAutoReply
Value : False
Key   : Status
Value : ACTIVE
Key   : HiddenFromGAL
Value : False
",Normal
20171211,04:47:23,UNIFY Identity Broker,Connector,Information,"Request to import changes from connector.
Request to import changes from connector PowerShell Exchange PROTECTED.",Normal
20171211,04:47:23,UNIFY Identity Broker,Connector,Information,"Import changes from connector completed.
Import changes from connector PowerShell Exchange PROTECTED reported 0 changes. Duration: 00:00:00",Normal
20171211,04:47:23,UNIFY Identity Broker,Change detection engine,Information,"Change detection engine import changes completed.
Change detection engine import changes for connector PowerShell Exchange PROTECTED returned 0 possible changes. Duration: 00:00:04.8439784",Normal


The part of the script the creates the entities is as follows. When I generated that log above I had the two lines uncommented that log the full $entity:

###
### Create/update entities
###
if ($ManagedUsers.count -gt 0) 
{
    $logger.LogInformation("$LogPrefix Creating {0} entities" -f $ManagedUsers.count.ToString())
    foreach ($user in $ManagedUsers)
    {
        $entity = $entities.Create()
        $entity["PersonNumber"] = $user.employeeNumber
        $entity["DN"] = $user.DistinguishedName
        $entity["Status"] = $user.extensionAttribute13
        if ($Mailboxes.ContainsKey($user.DistinguishedName))
        {
            $mb = $Mailboxes.($user.DistinguishedName)
            $entity["DirectPermissions"] = $mb.DirectPermissions
            $entity["HiddenFromGAL"] = $mb.HiddenFromGAL
            $entity["MailboxType"] = $mb.MailboxType
            $entity["PrimaryEmailAddress"] = $user.mail
            $entity["ProxyEmailAddresses"] = $mb.EmailAddresses
            $entity["TerminationAutoReply"] = $mb.TerminationAutoReply
            $entity["TerminationMailCount"] = $mb.TerminationMailCount
        }
        else
        {
            $entity["DirectPermissions"] = $null
            $entity["HiddenFromGAL"] = $false
            $entity["MailboxType"] = $null
            $entity["PrimaryEmailAddress"] = $null
            $entity["ProxyEmailAddresses"] = $null
            $entity["TerminationAutoReply"] = $false
            $entity["TerminationMailCount"] = $null
        }
        #[string]$str = $entity | fl | out-string
        #$logger.LogInformation($str)
        $entity.Commit()
    }
}

I'm on v5.1.0 Revision #1. I should be able to upgrade but it's a bit of a process to get software into the environment, so is there anything else I should be looking at?

Answer

Answer

You were right - I had the default (Entity Id) selected when I needed Entity. I thought this seemed familiar - I have definitely hit this before.

Under review

Hi Carol,

Which Import Changes type is it, Entity Changes or Entity ID Changes? Is there any other relevant information that might help us diagnose, for example has an Import Changes ever run successfully in the past?

Answer

You were right - I had the default (Entity Id) selected when I needed Entity. I thought this seemed familiar - I have definitely hit this before.