Quantcast
Viewing all articles
Browse latest Browse all 4767

FIM PowerShell Connector - Export in large number of modifications

I am exporting modifications in large numbers through FIM PowerShell connector, and I have yet to understand the 3 different export script sections, mainly Begin Export Script and Export Script.

From the definition given by Microsoft, 

The begin export script is run at the beginning of an export run step. During this step, you can establish a connection to source systems and conduct any preparatory steps prior to exporting data from the connected system.

The Synchronization Service will call the Export Data script as many times as is necessary to process all of the pending exports. Depending on whether or not the connector space has more pending exports than the connector’s page size, the presence of reference attributes, or passwords, the export data script may be called multiple times and possibly multiple times for the same object.

And I followed the definition closely.

My plan is because I'm planning to export to O365, then I will do the connection once in Begin Export Script, like this:

[CmdletBinding()]param([ValidateNotNull()][System.Collections.ObjectModel.KeyedCollectionstring], [Microsoft.MetadirectoryServices.ConfigParameter]$ConfigParameters,[ValidateNotNull()][PSCredential]$PSCredential,[Microsoft.MetadirectoryServices.OpenExportConnectionRunStep]$OpenExportConnectionRunStep,[ValidateNotNull()][Microsoft.MetadirectoryServices.Schema]$Schema)Set-StrictMode-Version3Import-Module(Join-Path-Path([Microsoft.MetadirectoryServices.MAUtils]::MAFolder)-ChildPath'FIM.O365.psm1')-Verbose:$false-ErrorActionStopImport-ModuleMSOnline-Verbose:$false-ErrorActionStopConnect-MsolService-Credential$PSCredential-ErrorActionStop

However, when I tried to use the command get-msoluser in Export Script, it gave me this error: You must call the Connect-MsolService cmdlet before calling any other cmdlets. So, is something like this possible?

Secondly, I have over 20k modification to export. My Export Script at high level looks something like this:

$putExportEntriesResults=new-object -TypenameMicrosoft.MetadirectoryServices.PutExportEntriesResults

foreach($CSEntryin$CSEntries)

{

   #do stuffs here...

   $csEntryChangeResult =[Microsoft.MetadirectoryServices.CSEntryChangeResult]::Create($CSEntry.Identifier,$CSEntry.AttributeChanges,"Success")

      $putExportEntriesResults.CSEntryChangeResults.Add($csEntryChangeResult)|Out-Null

}

Write-Output$putExportEntriesResults

When I run the actual export, I actually have to wait until the whole export finishes before I see any feedback on how many updates were successful, or failed. How should my export script be modified in order for me to get updates as the export is happening?

Thank you all for your time.


Viewing all articles
Browse latest Browse all 4767

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>