<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>missmiis &#187; MIIS 2003</title>
	<atom:link href="http://www.wapshere.com/missmiis/category/ilm/miis2003/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wapshere.com/missmiis</link>
	<description>Adventures in identity management</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:41:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>More fun with powershell and XML &#8211; getting flow rule source attributes from a MA config file</title>
		<link>http://www.wapshere.com/missmiis/more-fun-with-powershell-and-xml-getting-flow-rule-source-attributes-from-a-ma-config-file</link>
		<comments>http://www.wapshere.com/missmiis/more-fun-with-powershell-and-xml-getting-flow-rule-source-attributes-from-a-ma-config-file#comments</comments>
		<pubDate>Fri, 07 Oct 2011 07:07:19 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[FIM 2010]]></category>
		<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[Office 365]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=1717</guid>
		<description><![CDATA[Today I was trying to find a list of all attributes synchronized to Office365 by DirSync. I couldn&#8217;t find a published list so I figured I&#8217;d just get it from the MA, using powershell to extract the list of source attributes. The list of AD user attributes synchronized by DirSync is at the bottom of this [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was trying to find a list of all attributes synchronized to Office365 by DirSync. I couldn&#8217;t find a published list so I figured I&#8217;d just get it from the MA, using powershell to extract the list of source attributes. The list of <strong>AD user</strong> attributes synchronized by DirSync is at the bottom of this post, and in between I&#8217;ll show you how I got there.</p>
<p>Note while I&#8217;m talking DirSync here this method will work for MIIS, ILM and FIM Management Agents.</p>
<p><span id="more-1717"></span></p>
<h3>Export the MA</h3>
<p>DirSync is just ILM and you can get into the Identity Manager client by running:</p>
<p>C:\Program Files\Microsoft Online Directory Sync\SYNCBUS\UIShell\miisclient.exe</p>
<p>Note: If you get an error about not having rights then add your account into the MIISAdmins group on the DirSync server then re-login.</p>
<p>Open the &#8220;Management Agents&#8221; page, click on the &#8220;SourceAD&#8221; MA to highlight it, then choose &#8220;Export Management Agent&#8221; from the Actions menu., and save the XML file.</p>
<p><a href="http://www.wapshere.com/missmiis/wp-content/uploads/2011/10/dirsync-parseMA-01.jpg"><img class="alignnone size-full wp-image-1718" title="dirsync-parseMA 01" src="http://www.wapshere.com/missmiis/wp-content/uploads/2011/10/dirsync-parseMA-01.jpg" alt="" width="629" height="292" /></a></p>
<h3>Parse the XML file in Powershell</h3>
<p>Now I go into powershell and load the content of the xml file into a variable:</p>
<pre>PS C:\scripts&gt; [xml]$xml = get-content .\dirsync-sourceAD.xml</pre>
<p>I can see all the import attribute flows like this:</p>
<pre>PS C:\scripts&gt; $xml."export-ma"."mv-data"."import-attribute-flow"."import-flow-set"

mv-object-type                                                                              import-flows
--------------                                                                              ------------
group                                                                                       {import-flows, import-flows, import-flows, import-flows...}
contact                                                                                     {import-flows, import-flows, import-flows, import-flows...}
person                                                                                      {import-flows, import-flows, import-flows, import-flows...}</pre>
<p>Right now I&#8217;m only interested in the &#8220;person&#8221; attribute flows:</p>
<pre>PS C:\scripts&gt; $xml."export-ma"."mv-data"."import-attribute-flow"."import-flow-set"[2]

mv-object-type                                                                              import-flows
--------------                                                                              ------------
person                                                                                      {import-flows, import-flows, import-flows, import-flows...}</pre>
<p>This next one lists the defined attribute flows. There&#8217;s a lot more but I&#8217;m just showing the top few.</p>
<pre>PS C:\scripts&gt; $xml."export-ma"."mv-data"."import-attribute-flow"."import-flow-set"[2]."import-flows"

mv-attribute                                                  type                                                         import-flow
------------                                                  ----                                                         -----------
assistant                                                     ranked                                                       {import-flow, import-flow}
company                                                       ranked                                                       {import-flow, import-flow}
department                                                    ranked                                                       {import-flow, import-flow}
displayName                                                   ranked                                                       {import-flow, import-flow}
facsimileTelephoneNumber                                      ranked                                                       {import-flow, import-flow}
givenName                                                     ranked                                                       {import-flow, import-flow}</pre>
<p>It might look as though the mv-attribute is what I want, but actually that&#8217;s an internal sync service attribute, and not the Active Directory attribute. I need to go a little deeper into the xml to get that.</p>
<p>First I&#8217;ll define a new variable to simplify my xml path:</p>
<pre>PS C:\scripts&gt; $importflows = $xml."export-ma"."mv-data"."import-attribute-flow"."import-flow-set"[2]."import-flows"</pre>
<p>Then all I have to do is loop through picking out the &#8220;src-attribute&#8221;. The results are listed below:</p>
<pre>PS C:\scripts&gt; foreach ($iaf in $importflows) {$iaf."import-flow"[0]."direct-mapping"."src-attribute"}
assistant
company
department
displayName
facsimileTelephoneNumber
givenName
homePhone
initials
manager
mobile
physicalDeliveryOfficeName
postalCode
telephoneNumber
title
mailNickname
ipPhone
middleName
otherFacsimileTelephoneNumber
otherHomePhone
otherIpPhone
otherMobile
otherPager
otherTelephone
pager
countryCode
description
info
streetAddress
wWWHomePage
url
extensionAttribute11
extensionAttribute12
extensionAttribute13
extensionAttribute14
extensionAttribute15
mail
cn
l
co
sn
st
postOfficeBox
msRTCSIP-UserEnabled
legacyExchangeDN
msExchHideFromAddressLists
msExchMailboxGuid
msExchAssistantName
msDS-HABSeniorityIndex
msDS-PhoneticDisplayName
msExchArchiveGUID
msExchBypassModerationFromDLMembersLink
msExchBypassModerationLink
msExchEnableModeration
msExchImmutableId
msExchModeratedByLink
msExchModerationFlags
msExchRecipientDisplayType
msExchResourceCapacity
preferredLanguage
publicDelegates
telephoneAssistant
msExchResourceDisplay
thumbnailPhoto
msExchBlockedSendersHash
msExchSafeRecipientsHash
msExchSafeSendersHash
extensionAttribute1
extensionAttribute10
extensionAttribute2
extensionAttribute3
extensionAttribute4
extensionAttribute5
extensionAttribute6
extensionAttribute7
extensionAttribute8
extensionAttribute9
msExchResourceMetaData
msExchResourceSearchProperties
msRTCSIP-Line
msRTCSIP-PrimaryUserAddress
targetAddress
msExchSenderHintTranslations
msExchArchiveName
msRTCSIP-DeploymentLocator
msExchRemoteRecipientType
msExchLitigationHoldDate
msExchLitigationHoldOwner
msExchRecipientTypeDetails
msExchRetentionComment
msExchRetentionURL
msExchAuditAdmin
msExchAuditDelegate
msExchAuditDelegateAdmin
msExchBypassAudit
msExchDelegateListLink
msExchELCExpirySuspensionEnd
msExchELCExpirySuspensionStart
msExchELCMailboxFlags
msExchMailboxAuditEnable
msExchMailboxAuditLogAgeLimit
msRTCSIP-OptionFlags
msExchUsageLocation

____________________________________________________________________________________________________________________________________________________________________________________</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/more-fun-with-powershell-and-xml-getting-flow-rule-source-attributes-from-a-ma-config-file/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Using powershell to parse a csexport file</title>
		<link>http://www.wapshere.com/missmiis/using-powershell-to-parse-a-csexport-file</link>
		<comments>http://www.wapshere.com/missmiis/using-powershell-to-parse-a-csexport-file#comments</comments>
		<pubDate>Sun, 25 Sep 2011 04:31:15 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[FIM 2010]]></category>
		<category><![CDATA[FIM Sync Service]]></category>
		<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=1710</guid>
		<description><![CDATA[From time to time it&#8217;s necessary to access detailed data about objects in the connector space of a FIM Sync MA. One way to do this is with the csexport command line tool (found in the Bin folder) but the XML it produces isn&#8217;t particularly pretty and it doesn&#8217;t open nicely in Excel.
Luckily powershell has [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time it&#8217;s necessary to access detailed data about objects in the connector space of a FIM Sync MA. One way to do this is with the <strong>csexport</strong> command line tool (found in the Bin folder) but the XML it produces isn&#8217;t particularly pretty and it doesn&#8217;t open nicely in Excel.</p>
<p>Luckily powershell has some great XML parsing capability, so here&#8217;s a little script I wrote which takes an XML file created by csexport, and produces a CSV file more suitable for opening in Excel. Note that the script only supports single-valued attributes &#8211; you can modify it yourself if you need multi-values.</p>
<p><span id="more-1710"></span><br />
<code></code></p>
<pre>#
# parse-csexport.ps1
#

# Change the following list to get different attributes. The first four are available for all connector spaces.
$csvcolumns = @("dn","connector-type","connector-state","mv-guid","emailAddress","userName","sn","givenName","title","personalTitle")

$csvfile = "csexport.csv"
$csexportfile = "csexport.xml"

[xml]$csexport = get-content $csexportfile

if (Test-Path $csvfile) {Remove-Item -Path $csvfile}
foreach ($csvcol in $csvcolumns) {
  $csvheader = $csvheader + ";" + $csvcol
}
Add-Content $csvfile $csvheader

foreach ($csobj in $csexport."cs-objects"."cs-object") {
  $csobjhash = @{}
  $csobjhash.Add("dn",$csobj."cs-dn")
  # Disconnectors
  if ($csobj.connector -eq "0") {
    $csobjhash.Add("connector-type","disconnector")
    $csobjhash.Add("connector-state",$csobj."connector-state")
    $csobjhash.Add("mv-guid","")
    foreach ($attr in $csobj."unapplied-export-hologram".entry.attr) {
      if ($attr.multivalued -eq "false") {
        $csobjhash.Add($attr.name,$attr.value)
      }
    }
  }
  # Connectors
  else {
    $csobjhash.Add("connector-type","connector")
    $csobjhash.Add("connector-state",$csobj."connector-state")
    $csobjhash.Add("mv-guid",$csobj."mv-link"."#text")
    foreach ($attr in $csobj."synchronized-hologram".entry.attr) {
      if ($attr.multivalued -eq "false") {
        $csobjhash.Add($attr.name,$attr.value)
      }
    }
  }
  $csvline = ""
  foreach ($csvcol in $csvcolumns) {
    if ($csobjhash.Contains($csvcol)) {
      if ($csvline -eq "") {$csvline = $csobjhash.Item($csvcol) }
      else {$csvline = $csvline + ";" + $csobjhash.Item($csvcol) }
    }
    else {$csvline = $csvline + ";"}
  }
  $csvline
  Add-Content $csvfile $csvline
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/using-powershell-to-parse-a-csexport-file/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Overcoming multiple personality disorder in the source data</title>
		<link>http://www.wapshere.com/missmiis/overcoming-multiple-personality-disorder-in-the-source-data</link>
		<comments>http://www.wapshere.com/missmiis/overcoming-multiple-personality-disorder-in-the-source-data#comments</comments>
		<pubDate>Mon, 22 Nov 2010 08:16:52 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[FIM 2010]]></category>
		<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=1063</guid>
		<description><![CDATA[This post is going to describe an approach I&#8217;ve used a couple of times this year, in situations which looked quite different at the outset, but actually had one particular characteristic in common: the source data contained multiple records relating to individual people, and I needed access to all of them.
One case involves &#8220;contract&#8221; records [...]]]></description>
			<content:encoded><![CDATA[<p>This post is going to describe an approach I&#8217;ve used a couple of times this year, in situations which looked quite different at the outset, but actually had one particular characteristic in common: the source data contained multiple records relating to individual people, and I needed access to all of them.</p>
<p>One case involves &#8220;contract&#8221; records from an HR database &#8211; a person who had moved around the company may have several. The second is an LDAP data source for a univeristy where an inidvidual may have both staff and student profiles simultaneously, and as a student, may have multiple active &#8220;enrollments&#8221;.<br />
<span id="more-1063"></span></p>
<h3>In an ideal situation</h3>
<p>There is a key best practise at stake here, which I believe becomes even more significant when you put the FIM Portal into the mix:</p>
<blockquote><p><strong>Each individual should only be represented <u>once</u> in the Metaverse.</strong></p></blockquote>
<p>In an ideal situation you will project each person only once from your source data. Changes to contract, enrollment etc would be treated simply as attribute updates to the core Metaverse object, which remains the same.</p>
<p>If your source data lists people multiple times, as in my examples above, you might do some automated manipulation prior to presenting the data to the Sync Service &#8211; selecting the best representation of each person and merging data where appropriate. Then you can have a nice one-to-one relationship between your projectoin source and your Metaverse.</p>
<p><img src="http://www.wapshere.com/images/mpd/ideal.jpg" alt="" /></p>
<h3>But what if you need access to those individual contracts?</h3>
<p>This was my problem. In the case of the HR database contract records, the local IT only had access to the <em>contract number</em>. For them the important information related to the person&#8217;s job at that site. But for us, centrally, looking to automate moves and changes across the organisation, we needed a way to link those seperate contract numbers to one individual.</p>
<p>At first, and against my better judgement, we started off projecting the contracts into the Metaverse as seperate people. I was assured that, when people moved jobs, all their old accounts were deleted including their mailbox. Pretty quickly this turned out to be not the case at all, and I started with the messy gymnastics needed to reconnect existing accounts to the newer better contract in the Metaverse, without actually deleting anything.</p>
<p><img src="http://www.wapshere.com/images/mpd/messy.jpg" alt="" /></p>
<h3>Step One in solving data source MPD: Split the data into &#8220;Persons&#8221; and &#8220;Contracts&#8221;</h3>
<p>When it became clear that a redesign was necessary, I started by splitting the data into &#8220;persons&#8221; and &#8220;contracts&#8221;. In fact for the university this was already the case, but with the HR database I had to use some SQL queries in an SSIS package to split the data into &#8220;objectType=person&#8221; and &#8220;objectType=contract&#8221; rows. Clearly a unique identifier is needed for both persons and contracts.</p>
<p>My <strong>persons</strong> have the following basic information:</p>
<ul>
<li>objectType (=person)</li>
<li>personID</li>
<li>Data that should be independant of the contracts, like name, gender, date of birth.</li>
</ul>
<p>My <strong>contracts</strong> must include the personID so I can join them correctly:</p>
<ul>
<li>objectType (=contract)</li>
<li>contractID</li>
<li>personID</li>
<li>Data that is specific to the contract, like department, job title, start and end dates.</li>
</ul>
<h3>Create Seperate MAs for Persons and Contracts</h3>
<p>Once the data was seperated I created different MAs for persons and contracts. The aim is to project the person <em>only once</em> into the metaverse, and then join the changeable contract records from the second MA.</p>
<p><img src="http://www.wapshere.com/images/mpd/multijoin.jpg" alt="" /></p>
<h3>But what about the Import Flows?</h3>
<p>The big problem here is that you want to flow data into the metaverse from the Contracts MA. If multiple contracts are joined you&#8217;ll get the <strong>ambiguous-import-flow-from-multiple-connectors</strong> error. Besides which you probably don&#8217;t want to be importing from multiple contracts anyway. In my case (both cases in fact) I had to try and choose the &#8220;best&#8221; contract and then just flow the data from that one. As the &#8220;best&#8221; could change I have to re-evaluate the selection each time.</p>
<h3>Why not just join one contract at a time?</h3>
<p>The cleanest setup would be to only have one contract joined to the Metaverse object. The IAF rules are then very simple.</p>
<p>But, unless you can block all except <em>one contract per person</em> using Connector Filters, you may find this tricky to achieve.</p>
<p>Partly the problem is the way the Sync Service does its sync&#8217;ing &#8211; that is, it works on <em>one connector space object at a time</em>. Additionally, the only other connector space objects accessible during this sync operation are those that can be found by <em>following joins</em>.</p>
<p>So, while sync&#8217;ing <em>this</em> connector space object we can only know about <em>other</em> connector space objects where <em>a direct join relationship exists.</em></p>
<p>This essentially means I can only figure out if the current CS object is really the best choice if all possible contracts are joined to the Metaverse person at the same time.</p>
<h3>Blocking Import Flows</h3>
<p>So here&#8217;s where I ended up.</p>
<ol>
<li>I let the multiple contracts be joined to the Metaverse person, but I only allow import flows from one of the contracts.</li>
<li>I write the &#8220;preferred contract&#8221; number into an attribute on the person object.</li>
<li>When sync&#8217;ing a CS object I compare it to the current &#8220;preferred contract&#8221;. If this one is better I replace the contract number on the Metaverse object.</li>
<li>All the import flows (which must <em>all </em>be Advanced rules) check if this CS object is the preferred contract before allowing (or skipping) the flow.</li>
</ol>
<p>While my IAF rules are now more complex, there have been definite advantages to this approach. The non-preferred contracts are still accessible from the Metaverse object and this has allowed us to more easily identify errors in the source data. Sometimes we have forced a particular contract to be preferred by disconnecting the currently preferred contract and syncing another one.</p>
<p>There is also the benefit of having some information as opposed to none. If I was, for example, blocking all expired contracts from entering the connector space in the first place I would be losing valuable deprovisioning information. If the best pick contract for a person is an expired one, I still want to see it.</p>
<p><img src="http://www.wapshere.com/images/mpd/blockimport.jpg" alt="" /></p>
<h3>Flow Blocking Method 1: The Double Sync</h3>
<p>I have tried out two different ways of blocking IAFs. The first is simpler to implement but the downside is <strong>you have to Sync twice</strong>. Because the evaluation of the contract is done as part of the &#8220;import_contractID&#8221; rule, and this might happen at any point in the set of flow rules, to ensure all IAFs run for the new preferred contract you have to sync twice.</p>
<p><code></p>
<pre>Case "import_contractID"
  If mventry("contractID").Value &lt;&gt; csentry("contractID").Value
      <em>Whatever comparisons you need to do to see if this contract is preferable to the values
      already imported to the Metaverse object. If it's better, replace the contractID.</em>
  End If

Case "import_otherAttribute"
  '<em>Replicates a Direct IAF</em>
  If mventry("contractID").IsPresent AndAlso mventry("contractID").Value = csentry("contractID").Value
    If csentry("otherAttribute").IsPresent Then
      mventry("otherAttribute").Value = csentry("otherAttribute").Value
    Else
      mventry("otherAttribute").Delete()
    End If
  End If</pre>
<p> </code> </p>
<h3>Flow Blocking Method 2: The First Touch</h3>
<p>In an effort to avoid the double-sync I have started using another method where I run my comparison tests above the Case statement, and then set a Utils.TransactionProperties to show the test has run.</p>
<blockquote><p>Utils.TransactionProperties is the way to pass values between different bits of code run as part of the same object&#8217;s Sync operation.</p></blockquote>
<p>While I now only need to sync once, I still don&#8217;t know which IAF rule will get called first, so <b>I have to pass all comparison CS attributes to each IAF rule</b>.</p>
<p>Here&#8217;s what the MapAttributesForImport Sub looks like now:</p>
<p><code></p>
<pre>Public Sub MapAttributesForImport(ByVal FlowRuleName As String, ByVal csentry As CSEntry, ByVal mventry As MVEntry) Implements IMASynchronization.MapAttributesForImport

 <em> '' Evaluate this CS object to see if it is a better source for attribute flows to the joined Metaverse object.
  '' Using the Utils.TransactionProperties flag will ensure this test is made only at the start of sync'ing the CS object.</em>

  If Not Utils.TransactionProperties.Contains("FlowEnabled") Or Not mventry("contractID").IsPresent Then

    Dim BestMatch As Boolean = False
    If mventry("contractID").IsPresent Then
      If mventry("contractID").Value = csentry("contractID").Value Then
        BestMatch = True
      Else
          <em>Comparison tests - set BestMatch=True if this is a better match.</em>
      End If

      If BestMatch Then
        Utils.TransactionProperties("FlowEnabled") = csentry("contractID").Value
        <em>  ''Note: I set this to the contractID to avoid unexpected behaviour following a disconnection.</em>
      Else
        Utils.TransactionProperties("FlowEnabled") = "false"
      End If

    End If

    <em>'' Do not continue with flow rules if this CS object has a different id to the best match.</em>
    If Not Utils.TransactionProperties("FlowEnabled").Equals(csentry("contractID").Value) Then
      Exit Sub
    End If

    Select Case FlowRuleName

      Case "Import_contractID"
        mventry("contractID").Value = csentry("contractID").Value

      Case "Import_otherAttribute"
        If csentry("otherAttribute").IsPresent Then
          mventry("otherAttribute").Value = csentry("otherAttribute").Value
        Else
          mventry("otherAttribute").Delete()
        End If

      ....

  End Select
End Sub</pre>
<p></code></p>
<h3>Importing a reference</h3>
<p>There is one final advantage I can extract out of seperating my data into persons and contracts &#8211; I can, if I need to, also import &#8220;contract&#8221; objects into the Metaverse and, with the addition of a <a href="http://www.wapshere.com/missmiis/configuration-of-the-sql-ma">multivalue table</a> (for database MAs) I can construct a reference attribute that directly links the person to their contract ojects. This would be very useful if I wanted a person&#8217;s contracts to be accessible in the FIM Portal.</p>
<p><img src="http://www.wapshere.com/images/mpd/reference.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/overcoming-multiple-personality-disorder-in-the-source-data/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joining on the Metaverse GUID</title>
		<link>http://www.wapshere.com/missmiis/joining-on-the-metaverse-guid</link>
		<comments>http://www.wapshere.com/missmiis/joining-on-the-metaverse-guid#comments</comments>
		<pubDate>Mon, 15 Nov 2010 15:22:43 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[FIM 2010]]></category>
		<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[MIIS 2003]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=1078</guid>
		<description><![CDATA[Just a quick note on this as it&#8217;s something that wasn&#8217;t immediately obvious to me.
I was using the Metaverse GUID as an anchor for provisioning to a simple SQL MA like so:
csentry("mvguid").StringValue = mventry.ObjectID.ToString
However when I tried to do a direct join rule on csentry:mvguid = mventry:&#60;object-id&#62; I got  the error cannot-parse-object-id.
In fact the operation [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note on this as it&#8217;s something that wasn&#8217;t immediately obvious to me.</p>
<p>I was using the Metaverse GUID as an anchor for provisioning to a simple SQL MA like so:</p>
<p><code>csentry("mvguid").StringValue = mventry.ObjectID.ToString</code></p>
<p>However when I tried to do a direct join rule on csentry:mvguid = mventry:&lt;object-id&gt; I got  the error <strong>cannot-parse-object-id</strong>.</p>
<p>In fact the operation above had removed the brackets from the Guid string and I had to add them back in using an Advanced Join Rule:</p>
<p><code>values.Add("{" &#038; csentry("mvguid").StringValue &#038; "}")</code></p>
<p>Of course the other way would have been to add the brackets back in when setting the mvguid value on the csentry in the first place, but I&#8217;d already provisioned quite a few objects. I&#8217;ll do it like that next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/joining-on-the-metaverse-guid/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML Lookup file</title>
		<link>http://www.wapshere.com/missmiis/xml-lookup-file</link>
		<comments>http://www.wapshere.com/missmiis/xml-lookup-file#comments</comments>
		<pubDate>Fri, 05 Nov 2010 10:25:23 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[FIM 2010]]></category>
		<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=1039</guid>
		<description><![CDATA[On my first ever MIIS project we were an OCG customer so were able to use their nice XML library. I can&#8217;t remember in great detail what it did, but I&#8217;ve always considered the concept a best practise: if there&#8217;s anything that you find yourself hard-coding as a constant value in extension code, then you [...]]]></description>
			<content:encoded><![CDATA[<p>On my first ever MIIS project we were an OCG customer so were able to use their nice XML library. I can&#8217;t remember in great detail what it did, but I&#8217;ve always considered the concept a best practise: if there&#8217;s anything that you find yourself hard-coding as a constant value in extension code, then you should put it in a lookup file, where you can change the values later without having to recompile the code.<br />
<span id="more-1039"></span></p>
<p>I&#8217;ve been working on a couple of projects this year which are big and complicated enough to warrant a proper lookup file, so I&#8217;ve finally had to get in and figure out how to parse XML in .NET. As usual this post is just about things I&#8217;ve been doing and I&#8217;m not trying to say this is the best way to go. You will have to adapt to your own requirements.    </p>
<h3>The Structure of the XML File</h3>
<p>The general outline of my XML file is to have a section for Global settings, and then individual sections for each MA. Note the &#8220;tag&#8221; for each MA, which I&#8217;ll be using in the code.  The specifc values you include for each MA are entirely up to your requirements.</p>
<pre>&lt;SyncParams&gt;
  &lt;Global&gt;
    &lt;SyncService&gt;
      &lt;ServerName&gt;mysyncserver.mydomain.com&lt;/ServerName&gt;
      &lt;IsDev&gt;False&lt;/IsDev&gt;
    &lt;/SyncService&gt;
    &lt;SQL&gt;
      &lt;Server&gt;mysqlserver.mydomain.com&lt;/Server&gt;
    &lt;/SQL&gt;
  &lt;/Global&gt;
  &lt;ManagementAgents&gt;
    &lt;MA name='FIM Portal' tag='MAName_FIM'&gt;
      &lt;maType&gt;FIM&lt;/maType&gt;
      &lt;MVobjectType&gt;person&lt;/MVobjectType&gt;
      &lt;MVobjectType&gt;group&lt;/MVobjectType&gt;
      &lt;MVobjectSource&gt;group&lt;/MVobjectSource&gt;
    &lt;/MA&gt;
    &lt;MA name='SQL HR Employees' tag='MAName_HR'&gt;
      &lt;maType&gt;SQL&lt;/maType&gt;
      &lt;MVobjectType&gt;person&lt;/MVobjectType&gt;
      &lt;MVobjectSource&gt;person&lt;/MVobjectSource&gt;
    &lt;/MA&gt;
    &lt;MA name='Notes' tag='MAName_Notes'&gt;
      &lt;maType&gt;NOTES&lt;/maType&gt;
      &lt;MVobjectType&gt;person&lt;/MVobjectType&gt;
      &lt;MVobjectSource&gt;person&lt;/MVobjectSource&gt;
    &lt;/MA&gt;
    &lt;MA name='AD mydomain' tag='MAName_AD'&gt;
      &lt;maType&gt;AD&lt;/maType&gt;
      &lt;provEnabled&gt;True&lt;/provEnabled&gt;
      &lt;MVobjectType&gt;person&lt;/MVobjectType&gt;
      &lt;MVobjectType&gt;group&lt;/MVobjectType&gt;
      &lt;OU_USERS_INTERNAL&gt;OU=Internal,OU=Users,OU=MyOrg,DC=mydomain,DC=com&lt;/OU_USERS_INTERNAL&gt;
      &lt;OU_USERS_EXTERNAL&gt;OU=External,OU=Users,OU=MyOrg,DC=mydomain,DC=com&lt;/OU_USERS_EXTERNAL&gt;
      &lt;OU_USERS_GENERIC&gt;OU=Generic,OU=Users,OU=MyOrg,DC=mydomain,DC=com&lt;/OU_USERS_GENERIC&gt;
      &lt;OU_USERS_RESIGNED&gt;OU=Resigned,OU=Users,OU=MyOrg,DC=mydomain,DC=com&lt;/OU_USERS_RESIGNED&gt;
      &lt;OU_GROUPS&gt;OU=Groups,OU=MyOrg,DC=mydomain,DC=com&lt;/OU_GROUPS&gt;
      &lt;OU_CONTACTS&gt;OU=Contacts,OU=MyOrg,DC=mydomain,DC=com&lt;/OU_CONTACTS&gt;
    &lt;/MA&gt;
  &lt;/ManagementAgents&gt;
&lt;/SyncParams&gt;</pre>
<h3>Initialization</h3>
<p>You can use the Initialization section of your extension code to open and load the XML lookup file. Note that you&#8217;ll have to do this in each extension project where you want to access parameters from the file. Your code will also need a reference to <strong>System.Xml</strong>.    </p>
<pre>    Dim xmlParams As Xml.XmlDocument

    Public Sub Initialize() Implements IMVSynchronization.Initialize
        xmlParams = New Xml.XmlDocument
        Dim xmlPath As String = Utils.ExtensionsDirectory &amp; "\SyncParams.xml"

        Try
            xmlParams.Load(xmlPath)
        Catch ex As Exception
            Throw New ExtensionException("Failed while opening XML parameter file. " &amp; ex.Message)
        End Try
    End Sub    </pre>
<h3>Accessing the Global parameters</h3>
<p>TheGlobal parameters are easy to get to because there&#8217;s only one node for them. So to retrieve the server name from the XML file above I&#8217;d just do this:  </p>
<pre>    xmlParams.SelectSingleNode("//Global/SyncService/ServerName").InnerText   </pre>
<h3>Accessing a specific MA&#8217;s Parameters</h3>
<p>The next thing you will probably want to do is access the values for a specifc MA. I&#8217;m using the &#8220;tag&#8221; attribute as a way to identitfy the correct node. In this example I retrieve an OU name from the &#8221;AD mydomain&#8221; parameters.   </p>
<pre>    xmlParams.SelectSingleNode("//ManagementAgents/MA[@tag='MAName_AD']/OU_USERS_EXTERNAL").InnerText</pre>
<h3>Creating a Hash Table of MA Names</h3>
<p>The other thing that can be useful is to make a hash table of MA Names for easy reference. First you need to define a global variable:  </p>
<pre>    Dim MA_Names As New Collection</pre>
<p>Then you add something like this to the Initialization sub:  </p>
<pre>    For Each xmlNode In xmlParams.SelectNodes("//ManagementAgents/MA")
        MA_Names.Add(xmlNode.Attributes("name").Value, xmlNode.Attributes("tag").Value)
    Next</pre>
<p>Now in the rest of the project, when you want to use an MA&#8217;s name, you only need refer to it using its tag:  </p>
<pre>    MA_Names.Item("MAName_AD").ToString </pre>
<h3>Selectively disabling provisioning</h3>
<p>Another thing you might like to do, especially if you have a number of MAs that you are provisioning to, is to be able to selectively disable the provisioning code for one of them just by using the XML file.</p>
<p>Obviously you&#8217;ll have to modify your provisioning code to check the value of the flag. In the example above I would need to test for the value of &#8220;provEnabled&#8221; before calling the provisioning code for the &#8220;AD mydomain&#8221; MA:</p>
<pre>
    If xmlParams.SelectSingleNode("//ManagementAgents/MA[@tag='MAName_AD']/provEnabled").InnerText = "True" then
        Provision_AD(mventry)
    End If</pre>
<h3>Conclusion</h3>
<p>Of course all of this takes more effort in the coding but the code will be more robust if it avoids hard-coded values, and it will be easier for others to make simple changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/xml-lookup-file/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OpenLDAP Provisioning</title>
		<link>http://www.wapshere.com/missmiis/openldap-provisioning</link>
		<comments>http://www.wapshere.com/missmiis/openldap-provisioning#comments</comments>
		<pubDate>Fri, 27 Aug 2010 11:16:59 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[FIM 2010]]></category>
		<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[OpenLDAP]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=882</guid>
		<description><![CDATA[After getting the OpenLDAP XMA working on FIM I hoped it would be possible to provision to it using FIM codeless sync. Unfortunately the conclusion I have come to is No, it isn&#8217;t. 
The sticking problem is the objectClass. Typically objects in LDAP will have more than one objectClass, and the only way to set them in MIIS/ILM [...]]]></description>
			<content:encoded><![CDATA[<p>After getting the <a href="http://www.wapshere.com/missmiis/compiling-the-openldap-xma-to-use-with-fim-2010">OpenLDAP XMA working on FIM</a> I hoped it would be possible to provision to it using FIM codeless sync. Unfortunately the conclusion I have come to is No, it isn&#8217;t.<span id="more-882"></span> </p>
<p>The sticking problem is the objectClass. Typically objects in LDAP will have more than one objectClass, and the only way to set them in MIIS/ILM is in the metaverse extension code. It is no different with FIM. There is no way to set objectClass from a codeless sync rule, and you can&#8217;t set it in an export attribute flow. </p>
<p>So a Metaverse extension is still the way to go. Here is an example of a provisioning rule for OpenLDAP. I am creating a posixAccount, mostly as a way of showing how to add the dependant objectClasses. Your objectClasses will no doubt vary.</p>
<p>I have included a couple of functions that I am using to generate a password hash and to find the next uidNumber. Note for the latter function the Terminate sub is also implicated.</p>
<div></div>
<p><code></p>
<pre>Imports Microsoft.MetadirectoryServices
Imports System.DirectoryServices
Imports System.Text
Imports System.IO
Imports System.Security.Cryptography

Public Class MVExtensionObject
    Implements IMVSynchronization

    '' It is a better practise to put these constants in a lookup file
    Const OL_SERVER As String = "myldapserver.mydomain.com"
    Const OL_ROOT As String = "dc=myldap,dc=mydomain,dc=com"
    Const OL_OU_USERS As String = "ou=users,dc=myldap,dc=mydomain,dc=com"
    Const OL_UIDFILE As String = "C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service\MaData\openLDAP\uidNumber.txt"
    Const OL_READ_USER As String = "cn=fimread,ou=users,dc=myldap,dc=mydomain,dc=com"
    Const OL_READ_PW As String = "password"
    Const OL_DEFAULT_GROUP As String = "1000"

    Public Sub Initialize() Implements IMVSynchronization.Initialize
        ' TODO: Add initialization code here
    End Sub

    Public Sub Terminate() Implements IMVSynchronization.Terminate
    '' Deleting this file forces a new LDAP search the next time, allowing for accounts which may have been created manually.
        If File.Exists(OL_UIDFILE) Then
            File.Delete(OL_UIDFILE)
        End If
    End Sub

    Public Sub Provision(ByVal mventry As MVEntry) Implements IMVSynchronization.Provision
        Select Case mventry.ObjectType
            Case "person"
                Provision_OpenLDAPPerson(mventry)
        End Select
    End Sub

    Sub Provision_OpenLDAPPerson(ByVal mventry As MVEntry)
        Dim ShouldExist As Boolean = False
        Dim DoesExist As Boolean
        Dim CSEntry As CSEntry
        Dim OLMA As ConnectedMA = mventry.ConnectedMAs("openLDAP")
        Dim expectedDN As ReferenceValue
        Dim Container As String

        '' Should the account exist? (Add more logic here to decide)
        ShouldExist = True

        '' Does the account already exist?
        If OLMA.Connectors.Count = 0 Then
            DoesExist = False
        Else
            DoesExist = True
        End If

        '' Generate the expected DN for the user - to use in creating or moving
        If mventry("accountName").IsPresent And ShouldExist Then
            Dim RDN As String = "cn=" &amp; mventry("accountName").StringValue.ToLower
            expectedDN = OLMA.EscapeDNComponent(RDN).Concat(OL_OU_USERS)
        End If

        '' Take action based on values of ShouldExist and DoesExist
        If ShouldExist And DoesExist Then
            '' Check if rename needed
            If csentry.DN.ToString.ToLower &lt;&gt; expectedDN.ToString.ToLower Then
                csentry.DN = expectedDN
            End If

        ElseIf ShouldExist And Not DoesExist Then
            '' Create Account

            ' Set objectClasses
            Dim oc As ValueCollection
            oc = Utils.ValueCollection("inetOrgPerson")
            oc.Add("person")
            oc.Add("organizationalPerson")
            oc.Add("inetOrgPerson")
            oc.Add("posixAccount")
            oc.Add("shadowAccount")
            oc.Add("simpleSecurityObject")
            CSEntry = OLMA.Connectors.StartNewConnector("posixAccount", oc)
            CSEntry.DN = expectedDN

            ' Find next available uidNumber
            CSEntry("uidNumber").Value = = NextUidNumber(OL_SERVER, OL_ROOT).ToString

            ' Set initial password
            CSEntry("userPassword").Value = "{MD5}" &amp; GenerateHash("INitial001")

            ' The following could also be done as export flow rules
            CSEntry("gidNumber").Value = OL_DEFAULT_GROUP
            CSEntry("sn").Value = mventry("lastName").Value
            CSEntry("givenName").Value = mventry("firstName").Value
            CSEntry("cn").Value = mventry("accountName").Value.ToLower
            CSEntry("uid").Value = mventry("accountName").Value.ToLower
            CSEntry("displayName").Value = mventry("firstName").StringValue &amp; " " &amp; mventry("lastName").StringValue.ToUpper

            CSEntry.CommitNewConnector()

        ElseIf Not ShouldExist And DoesExist Then
            '' Delete
            CSEntry = OLMA.Connectors.ByIndex(0)
            CSEntry.Deprovision()

        End If
    End Sub

    Public Function NextUidNumber(ByVal ldapServerName As String, ByVal searchRoot As String) As Integer
    '' The first time the function runs it finds the highest uidNumber in LDAP and stores it in a text file.
    '' On subsequent runs it retrieves the last uidNumber straight from the text file. This allows for sync runs
    '' where multiple accounts are created.
    '' The text file is deleted as part of the Terminate routine.

        Dim oSearcher As New DirectorySearcher
        Dim oResults As SearchResultCollection
        Dim oResult As SearchResult
        Dim lastuid As Integer = 0

        If File.Exists(UIDFILE) Then
            Dim fileReader As New StreamReader(UIDFILE)
            lastuid = CInt(fileReader.ReadLine)
            fileReader.Close()
        Else
            Try
                With oSearcher
                    .SearchRoot = New DirectoryEntry("LDAP://" &amp; ldapServerName &amp; "/" &amp; searchRoot, _
                                                     "cn=root,dc=ldap,dc=eesp,dc=ch", "hesso_2010", AuthenticationTypes.FastBind)
                    .PropertiesToLoad.Add("uidNumber")
                    .Filter = "uidNumber=*"
                    oResults = .FindAll()
                End With

                For Each oResult In oResults
                    If oResult.GetDirectoryEntry().Properties("uidNumber").Value &gt; lastuid Then
                        lastuid = oResult.GetDirectoryEntry().Properties("uidNumber").Value
                    End If
                Next

            Catch e As Exception
                Throw New UnexpectedDataException(e.Message)
                Return -1
            End Try
        End If

        Dim fileWriter As New StreamWriter(UIDFILE, False)
        fileWriter.WriteLine(lastuid + 1)
        fileWriter.Close()

        Return lastuid + 1
    End Function

    Private Function GenerateHash(ByVal SourceText As String) As String
        ' Returns the MD5 hash of the SourceText string.
        Dim Ue As New UTF7Encoding()
        Dim ByteSourceText() As Byte = Ue.GetBytes(SourceText)
        Dim Md5 As New MD5CryptoServiceProvider()
        Dim ByteHash() As Byte = Md5.ComputeHash(ByteSourceText)
        Return Convert.ToBase64String(ByteHash)
    End Function

End Class</pre>
<p> </p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/openldap-provisioning/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phase One Joins and Data Matching</title>
		<link>http://www.wapshere.com/missmiis/phase-one-joins-and-data-matching</link>
		<comments>http://www.wapshere.com/missmiis/phase-one-joins-and-data-matching#comments</comments>
		<pubDate>Thu, 03 Jun 2010 12:03:32 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[FIM 2010]]></category>
		<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[MIIS 2003]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=827</guid>
		<description><![CDATA[I&#8217;ve just posted a new Greatest Hits article on the ILM forum on the subject of how ILM (or the FIM Sync Service) can be used to clean up the mess of existing accounts, before you can actually get  on to the more interesting tasks of provisioning and updating. With the way FIM codeless sync works, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just posted a <a href="http://social.technet.microsoft.com/Forums/en-US/identitylifecyclemanager/thread/be607357-2e40-4161-af53-83f3f59c5a54">new Greatest Hits article</a> on the ILM forum on the subject of how ILM (or the FIM Sync Service) can be used to clean up the mess of existing accounts, before you can actually get  on to the more interesting tasks of provisioning and updating. With the way FIM codeless sync works, needing an existing attribute to match on, and only allowing simple matching rules, it will be more important than ever to start from a position of tidy directories with correctly identified existsing accounts. Here&#8217;s the article&#8230;<span id="more-827"></span> </p>
<h2>Phase One Joins and Data Matching</h2>
<p>The tedious truth is that most IdM projects must begin with a phase of data matching and cleaning. Before you can start to automate management of identities, you need a predictable<br />
data set around which to base your rules. Many organizations today, whether due to changes in IT personnel, company mergers, variable naming conventions or lack of guidance on handling resignations, have existing user account bases that can only be described as a mess.</p>
<p>This document covers some of the methods you can use with ILM to get through that first project phase. Unfortunately there are no magic bullets here – eye-straining, brain-numbing trawls through long lists of unmatched accounts cannot usually be avoided. What you can do is try to extract quality data, and construct your lists as helpfully as possible, so they can be targeted at the people whose eyeballs and brains are most likely to give the best response.</p>
<p>It must be added that this is a very big topic, and the methods you choose will depend on the data you are faced with, and the aims of your project.</p>
<h2 style="color: #365f91; font-size: 14px; font-weight: bold;">Joins</h2>
<p>Really, it’s all about joins.</p>
<p>Once existing accounts are joined to their correct data source (such as matching an HR record to an AD account) you can begin to flow updates.</p>
<p>Once you have a clear idea who does and does not have an account in a target directory, you can begin to make provisioning and deprovisioning decisions.</p>
<div>But be careful – your joins must be reliable! The last thing you want is to kill the credibility of your fledgling IdM project by updating someone’s account with another person’s details or, even worse, deleting their account because you thought they’d left! </div>
<div><strong> </strong></div>
<p><strong> </p>
<p></strong></p>
<h3 style="color: #365f91; font-size: 13px; font-weight: bold;">Your eventual aim is a simple Join Rule</h3>
<p>When you first start data matching, you will use a lot of different join rules, and you will make joins manually and with CSV files (more on that below). But keep<br />
this in mind: </p>
<p><strong>Any join made manually, or with extra effort, should be considered temporary.</strong> </p>
<p>There are various situations in ILM which can only be reliably rectified by a clear-out and re-import of a connector space.</p>
<p>Always plan for this.</p>
<p>Ideally, when you re-import a connector space, you will have a single, direct join rule which effortlessly re-joins all your objects. And to achieve this we use&#8230; </p>
<h3 style="color: #365f91; font-size: 13px; font-weight: bold;">Breadcrumbing</h3>
<p>Once the join is verified you should export a uniquely identifying attribute, such as an employee number, to the target directory.</p>
<p>After that a simple “<em>employeeID = employeeID</em>” type join rule is all you will need. </p>
<p><img src="http://public.bay.livefilestore.com/y1puu1gB56bAwNV0j6l5x2arQF_QoG9rXeWeWhfCwNo7IE_bMzlEmKJickwi1p_DwfxfQ5tMoc61tlLdl-OQ5CZow/CW01.png" alt="" width="602" height="150" /> </p>
<p>Sometimes you are faced with an import-only system. For either technical or political reasons you are not able to export the breadcrumb attribute.</p>
<p>There are a couple of things you can do: </p>
<ol>
<li> Import the DN or other identifying attribute from the target directory into an attribute on the Metaverse object.<strong>But be warned</strong>, you could still lose these joins if you had to repopulate your Metaverse.</li>
<li> To be on the safe side you should also “save” these joins by exporting an identifying pair somewhere else – for example using a database or text file<br />
MA, as pictured below.</li>
</ol>
<p><img src="http://public.bay.livefilestore.com/y1pvIj0ZbLAvgRj_vd6hwUtb7dq1sv3Qd9Q0OraE_hLtCfEzrNaDwcbf7LaQIYkELBIocV0-A0ZP211HvM092E6WA/CW02.png" alt="" width="602" height="208" /> </p>
<h3 style="color: #365f91; font-size: 13px; font-weight: bold;">Understanding Join Rules</h3>
<p>There are some key points to note about Join Rules: </p>
<ol>
<li>Join rules operate on the CS object. It takes one CS object and attempts to find a match among all Metaverse objects of the correct type, even if they are already joined.</li>
<li>Components within one rule are AND-ed together – they must all match.</li>
<li>Multiple rules are evaluated top down, so put your strongest rules at the top.</li>
<li>While you can offer variations on a CS objects attribute using an Advanced Join Rule, you have to find an exact match with an attribute already on a Metaverse<br />
object. There are no “<em>StartsWith</em>” or “<em>Contains</em>” comparisons.</li>
</ol>
<h2 style="color: #365f91; font-size: 14px; font-weight: bold;">Resolve Join</h2>
<p>At the bottom of the Join Rule configuration you will see a check box “<em>Use rules extension to resolve</em>”.</p>
<p>Here you can link to code you write under the <em>ResolveJoinSearch</em> subroutine in the MA extension.</p>
<p>The Resolve rule is used when ILM finds multiple possible matches in the Metaverve (including already-joined objects).</p>
<p>All the possible matches into the collection rgmventry and your job, in the code, is to check through them, looking for the best possible match.</p>
<p>If your code finds an ideal match you return the index number of the object in imventry, and set the value of ResolveJoinSearch to true.</p>
<p>The following example only joins if a single, unjoined Metaverse object was found. </p>
<div style="background-color: #e6e6e6; width: 620px; overflow: scroll;">
<pre style="background-color: #e6e6e6; font-family: 'Courier New'; font-size: 11px;" lang="x-js">Public Function ResolveJoinSearch(ByVal joinCriteriaName As String, ByVal csentry As CSEntry, ByVal rgmventry() As MVEntry, ByRef imventry As Integer, ByRef MVObjectType As String) As Boolean Implements IMASynchronization.ResolveJoinSearch
<span lang="en-us">   </span>Select Case joinCriteriaName
<span lang="en-us">      </span>Case "Resolve_NotYetJoined"
<span lang="en-us">         </span>If rgmventry.Length = 1 AndAlso _
<span lang="en-us">   </span> <span lang="en-us">     </span> <span lang="en-us">  </span>rgmventry(0).ConnectedMAs("AD").Connectors.Count = 0  Then
<span lang="en-us">      </span> <span lang="en-us">  </span> <span lang="en-us">  </span>imventry = 0
<span lang="en-us">            </span>Return True
<span lang="en-us">         </span>Else
<span lang="en-us">            </span>Return False
<span lang="en-us">         </span>End If
<span lang="en-us">   </span>End Select
End Function</pre>
</div>
<h3 style="color: #365f91; font-size: 13px; font-weight: bold;">Advanced Join Rules</h3>
<p>A simple join rule directly matches a connector space attribute to a Metaverse attribute:</p>
<table style="border-collapse: collapse;" border="0">
<tbody>
<tr>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;">Connector Space</th>
<th style="text-align: center; background-color: #d4d0c8; width: 15px; font-size: 11px; font-weight: bold;"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;">Metaverse</th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
</tr>
<tr>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">givenName = Kathryn</td>
<td style="width: 15px;"> </td>
<td class="style1" style="font-size: 11px;">FirstName = Kathryn</td>
<td width="5"> </td>
</tr>
<tr>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">sn = Bigalow</td>
<td style="width: 15px;"> </td>
<td class="style1" style="font-size: 11px;">Lastname = Bigalow</td>
<td width="5"> </td>
</tr>
</tbody>
</table>
<p>With an Advanced Join Rule you construct a list of possible values with which to find an exact match in the Metaverse:</p>
<table style="border-collapse: collapse;" border="0">
<tbody>
<tr>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;">Connector Space</th>
<th style="text-align: center; background-color: #d4d0c8; width: 15px; font-size: 11px; font-weight: bold;"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;">Metaverse</th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
</tr>
<tr>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">givenName = KathryngivenName = KategivenName = Kathy</td>
<td style="width: 15px;"> </td>
<td class="style1" style="font-size: 11px;" valign="top">FirstName = Kate</td>
<td width="5"> </td>
</tr>
<tr>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">sn = Bigalow</td>
<td style="width: 15px;"> </td>
<td class="style1" style="font-size: 11px;" valign="top">Lastname = Bigalow</td>
<td width="5"> </td>
</tr>
</tbody>
</table>
<p>Sometimes you can use code rules to make your list of possible matches (eg., presenting a phone number in different formats); other times you have to use long<br />
look-up lists of possible variations (try genealogy websites for name-variation lists).</p>
<p>The following example uses a lookup file of aliases, where each line has the possible variations on a name.</p>
<p>If a match to the first name is found on the connector space object, the whole line is added to the possible values to search for in the Metaverse. </p>
<p>Elizabeth,Liz,Beth,Betty<br />
David,Dave,Davey<br />
Jerome,Jérôme<br />
&#8230; </p>
<div style="background-color: #e6e6e6; width: 620px; overflow: scroll;">
<pre style="background-color: #e6e6e6; font-family: 'Courier New'; font-size: 11px;" lang="x-js">Public Class MAExtensionObject
  <span lang="en-us"> </span>Implements IMASynchronization
  <span lang="en-us"> </span>Dim fileAliases As System.IO.StreamReader
  <span lang="en-us"> </span>Dim arrAliases As String()
  <span lang="en-us"> </span>Dim i As Integer

  <span lang="en-us"> </span>Public<span lang="en-us"> </span>Sub Initialize() Implements IMASynchronization.Initialize
    <span lang="en-us">  </span>fileAliases = New System.IO.StreamReader("C:\aliases.txt",  System.Text.Encoding.Default)
    <span lang="en-us">  </span>i = 0
    <span lang="en-us">  </span>While Not fileAliases.EndOfStream
      <span lang="en-us">   </span>ReDim Preserve arrAliases(i)
      <span lang="en-us">   </span>arrAliases(i) = fileAliases.ReadLine
      <span lang="en-us">   </span>i = i + 1
    <span lang="en-us">  </span>End While

    <span lang="en-us"> </span>fileAliases.Close()
  <span lang="en-us"> </span>End Sub

<span lang="en-us">   </span>Public Sub MapAttributesForJoin(ByVal FlowRuleName As String, ByVal csentry As CSEntry, ByRef values As ValueCollection) Implements IMASynchronization.MapAttributesForJoin
   <span lang="en-us">   </span>Select FlowRuleName
      <span lang="en-us">   </span>Case "Join_aliases"
         <span lang="en-us">   </span>Dim aliasList As String
         <span lang="en-us">   </span>Dim value As String

         <span lang="en-us">   </span>For Each aliasList In arrAliases
            <span lang="en-us">   </span>If aliasList.Contains(csentry("givenName").Value) Then
               <span lang="en-us">   </span>For Each value In aliasList.Split(",".ToCharArray)
                 <span lang="en-us"> </span> <span lang="en-us">  </span>values.Add(value)
               <span lang="en-us">   </span>Next
	<span lang="en-us">      </span>End If
         <span lang="en-us">   </span>Next
    <span lang="en-us">     </span>End Select
  <span lang="en-us">   </span>End Sub
End Class</pre>
</div>
<h2 style="color: #365f91; font-size: 14px; font-weight: bold;">Using CSV Files</h2>
<p>A lot of the difficult account matching will probably be done outside ILM.</p>
<p>It is therefore useful to be able to “export” lists of possible matches, and later, “import” the joins from a CSV file.</p>
<p>Be careful when writing to files from extension code – the DLL doesn’t unload for five minutes after the MA run completes, which means you may have to wait for it<br />
to finish writing to the file. If you’re in a hurry, recompiling the code will force the DLL to finish writing to the file. </p>
<h3 style="color: #365f91; font-size: 13px; font-weight: bold;">Export Possible Matches to a CSV file</h3>
<p>You can use the Resolve rule to export possible matches to a CSV file. The following example resolves the join rule “sn | Direct | lastname”. As a match on the last<br />
name alone is too weak for an immediate join, we just write the possible matches to the text file. </p>
<div style="background-color: #e6e6e6; width: 620px; overflow: scroll;">
<pre style="background-color: #e6e6e6; font-family: 'Courier New'; font-size: 11px;" lang="x-js">Public Class MAExtensionObject<span lang="en-us"> </span>Implements IMASynchronization
  <span lang="en-us"> </span>Dim fileMatches As System.IO.StreamWriter

<span lang="en-us"> <span class="style1">  </span></span>Public<span lang="en-us"> </span>Sub Initialize() Implements IMASynchronization.Initialize
    <span lang="en-us">  </span>fileMatches = New System.IO.StreamWriter("C:\possible matches.txt", System.Text.Encoding.Default)
  <span lang="en-us"> </span>End Sub

  <span lang="en-us"> </span>Public Sub Terminate() Implements IMASynchronization.Terminate
    <span lang="en-us">  </span>fileMatches.Close()
  <span lang="en-us"> </span>End Sub

<span lang="en-us">   </span>Public Function ResolveJoinSearch(ByVal joinCriteriaName As String, ByVal csentry As CSEntry, ByVal rgmventry() As MVEntry, ByRef imventry As Integer, ByRef MVObjectType As String) As Boolean Implements IMASynchronization.ResolveJoinSearch
  <span lang="en-us">    </span>Select Case joinCriteriaName
      <span lang="en-us"> <span class="style1">  </span></span>Case "Resolve_Lastname"
         <span lang="en-us">   </span>Dim MAName As String = csentry.MA.Name
         <span lang="en-us">   </span>Dim mvobject As MVEntry
         <span lang="en-us">   </span>Dim cFirstname, mFirstname As String

         <span lang="en-us">   </span>If csentry("givenName").IsPresent Then
     <span lang="en-us">          </span>cFirstname = csentry("givenName").StringValue
   <span lang="en-us">         </span>Else
     <span lang="en-us">       </span> <span lang="en-us">  </span>cFirstname = "UNKNOWN"
         <span lang="en-us">   </span>End If

         <span lang="en-us">   </span>If mvobject("firstname").IsPresent Then
     <span lang="en-us">       </span> <span lang="en-us">  </span>mFirstname = mvobject("firstname").StringValue
   <span lang="en-us">         </span>Else
     <span lang="en-us">       </span> <span lang="en-us">  </span>mFirstname = "UNKNOWN"
         <span lang="en-us">   </span>End If

         <span lang="en-us">   </span>For Each mvobject In rgmventry
           <span lang="en-us">    </span>If mvobject.ConnectedMAs(MAName).Connectors.Count = 0  Then
            <span lang="en-us"> <span class="style1">  </span></span> <span lang="en-us">  </span>fileMatches.WriteLine(csentry("sn").StringValue <span lang="en-us">&amp;</span> ";" _
     		<span lang="en-us">   &amp;</span> cFirstname <span lang="en-us">&amp;</span> ";" _
     		<span lang="en-us">   &amp;</span> mvobject("lastname").StringValue <span lang="en-us">&amp;</span> ";" _
     		<span lang="en-us">   &amp;</span> mFirstname)
           <span lang="en-us">    </span>End If
         <span lang="en-us">   </span>Next
         <span lang="en-us">   </span>Return False
<span lang="en-us">         </span>End Select
<span lang="en-us"> <span class="style1">  </span></span>End Function
<span lang="en-us">End Class</span></pre>
</div>
<p>You will need to adapt this code of course. Firstly, you probably want to export a lot more identifying information in your CSV file – department, email address,<br />
dn &#8230; whatever helps. Next, it can really help to supplement your possible matches with a probability score. This is where you do a series of tests and add points-<br />
the more points, the higher the chance of the match. For example: </p>
<ul>
<li>Names similar*          +1</li>
<li>Department the same +1</li>
<li>City the same           <br />
+1</li>
</ul>
<p>*Some tips for testing if names are similar: </p>
<ul>
<li>Strip out all spaces, dashes and hyphens then compare;</li>
<li>Check if one string is contained in the other (so that “Sally-Anne” gets<br />
a point for “Sally”);</li>
<li>Use a function which compares string similarity (search “Soundex” and “Levenshtein<br />
distance”).</li>
</ul>
<h2 style="color: #365f91; font-size: 14px; font-weight: bold;">Join from CSV</h2>
<p>You can use an Advanced Join Rule to “<em>import</em>” joins from a CSV file.</p>
<p>Firstly, our CSV file must be constructed like this: </p>
<p>CS_identifier;MV_identifier </p>
<p>For example, if we are trying to match an AD account against Metaverse objects imported from the HR system, we populate the CSV with the AD DN and the employeeID: </p>
<p>CN=Fred Bloggs,OU=User,OU=MyOrg,DC=mydomain,DC=com;0012988 </p>
<p>Next we create the Advanced Join Rule which will look up the csobject’s DN in the text file, but use the employeeID to search the Metaverse. </p>
<p>Note that you can’t actually use the DN in the join rule – but that’s ok, just use any attribute that definitely exists. Eg., </p>
<p>sAMAccountName | Rules extension – Join_CSV | employeeID </p>
<p>And now for the code : </p>
<div style="background-color: #e6e6e6; width: 620px; overflow: scroll;">
<pre style="background-color: #e6e6e6; font-family: 'Courier New'; font-size: 11px;" lang="x-js">Imports Microsoft.MetadirectoryServices

Public Class MAExtensionObject<span lang="en-us"> </span>Implements IMASynchronization
  <span lang="en-us"> </span>Dim joins As String()
  <span lang="en-us"> </span>Dim i As Integer

<span lang="en-us">   </span>Public<span lang="en-us"> </span>Sub Initialize() Implements IMASynchronization.Initialize
   <span lang="en-us">   </span>Dim fileJoins As System.IO.StreamReader
   <span lang="en-us">   </span>Dim strLine As String
   <span lang="en-us">  </span>'Open the csv file and read into an array
   <span lang="en-us">   </span>fileJoins = New System.IO.StreamReader("C:\joins.csv", System.Text.Encoding.Default)
   <span lang="en-us">   </span>i = 0
   <span lang="en-us">   </span>While Not fileJoins.EndOfStream
     <span lang="en-us"> </span> <span lang="en-us">  </span>ReDim Preserve joins(i)
     <span lang="en-us">    </span>joins(i) = fileJoins.ReadLine
      <span lang="en-us">   </span>i = i + 1
   <span lang="en-us">   </span>End While
   <span lang="en-us">   </span>fileJoins.Close()
<span lang="en-us">   </span>End Sub

<span lang="en-us">   </span>Public Sub MapAttributesForJoin(ByVal FlowRuleName As String, ByVal csentry As CSEntry, ByRef values As ValueCollection) Implements IMASynchronization.MapAttributesForJoin
   <span lang="en-us">   </span>Select FlowRuleName
      <span lang="en-us">   </span>Case "Join_CSV"
  <span lang="en-us">          </span>'If the csentry DN is found in the joins array, then
  <span lang="en-us">          </span>'use the paired employeeID to search the Metaverse.
        <span lang="en-us">    </span>For i = 0 To joins.Length - 1
          <span lang="en-us">     </span>If joins(i).Contains(csentry.DN.ToString) Then
            <span lang="en-us">   </span> <span lang="en-us">  </span>values.Add(joins(i).Split(";")(1))
          <span lang="en-us">     </span>End If
        <span lang="en-us"> </span>Next

   End Select
End Sub</pre>
</div>
<h2 style="color: #365f91; font-size: 14px; font-weight: bold;">Reporting</h2>
<p>People will ask you questions like “How many people have you joined in system X but not in Y?”, “How sure are you that the joins are correct?”, “Which department<br />
has the most unidentified accounts?” It’s best to be prepared for these sorts of questions. </p>
<h3 style="color: #365f91; font-size: 13px; font-weight: bold;">Querying the Metaverse</h3>
<p>Once data is in the Metaverse it is a simple matter to access it for reporting, either by exporting it into a reporting table, or by directly querying the underlying<br />
tables (as long as you’re careful to do it when ILM is idle, or else use NOLOCK). </p>
<p>So consider this: <strong>During the data cleaning phase, import all identifying attributes into the Metaverse from all sources</strong>. </p>
<p>For example: You’ve made a join between a user in AD and an HR record.</p>
<p>Under normal operations you would consider HR as the master source for the name, and you would only flow it from there.</p>
<p>You wouldn’t bother importing the name attributes from AD – in fact you’re more likely to be overwriting them with export flow rules.</p>
<table style="border-collapse: collapse;" border="0">
<tbody>
<tr>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;">HR</th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;">Metaverse</th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;">AD</th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
</tr>
<tr>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">Lastname = Powells-Brown</td>
<td width="5"> </td>
<td style="text-align: center; font-size: 11px;">-&gt;</td>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">lastname = Powells-Brown</td>
<td width="5"> </td>
<td style="text-align: center; font-size: 11px;">-&gt;</td>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">sn = Powells-Brown</td>
</tr>
<tr>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">Firstname = Joanna</td>
<td width="5"> </td>
<td style="text-align: center; font-size: 11px;">-&gt;</td>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">firstname = Joanna</td>
<td width="5"> </td>
<td style="text-align: center; font-size: 11px;">-&gt;</td>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">givenName = Joanna</td>
<td width="5"> </td>
</tr>
</tbody>
</table>
<p>However, during the data matching phase, you’re probably not ready to start overwriting attributes, and the information about current values can be very important in your<br />
verification and reporting.</p>
<table border="0">
<tbody>
<tr>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;">HR</th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;">Metaverse</th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;">AD</th>
<th style="background-color: #d4d0c8; text-align: center; font-weight: bold; font-size: 11px;" width="5"> </th>
</tr>
<tr>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">Lastname = Powells-Brown</td>
<td width="5"> </td>
<td style="text-align: center; font-size: 11px;">-&gt;</td>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">HR_lastname = Powells-Brown</td>
<td width="5"> </td>
<td style="text-align: center; font-size: 11px;">-&gt;</td>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">sn = Powells-Brown</td>
<td width="5"> </td>
</tr>
<tr>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">Firstname = Joanna</td>
<td width="5"> </td>
<td style="text-align: center; font-size: 11px;">-&gt;</td>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">HR_firstname = Joanna<br />
AD_lastname = Powells<br />
AD_firstname = Jo</td>
<td width="5"> </td>
<td style="text-align: center; font-size: 11px;">&lt;-<br />
&lt;-</td>
<td width="5"> </td>
<td class="style1" style="font-size: 11px;">givenName = Joanna<br />
givenName = Jo</td>
<td width="5"> </td>
</tr>
</tbody>
</table>
<p>Now, if you have a look at the <em>mms_metaverse</em> table in the ILM database, you will see how simple it is to query the progress of your joins, and also to judge<br />
on what criteria the joins were made.</p>
<p>Some example queries… </p>
<p>/* HR person with no join to AD */</p>
<p>select HR_lastname, HR_firstname, HR_employeeid from mms_metaverse<br />
where AD_dn is null </p>
<p> /* HR person with join to AD */</p>
<p>select HR_lastname, HR_firstname, HR_employeeid, AD_lastname,AD_firstname,AD_dn from mms_metaverse<br />
where AD_dn is not null </p>
<table style="width: 100%;" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th style="text-align: left; background-color: #c0c0c0;"><img src="http://apfhrw.bay.livefilestore.com/y1psOzY0M-yAjhcC7950DyjOEOMTO7g7UXPJsJ3MsIEAGPWZ7cLWtso19wWC_aIFviX49wqL5BR_hx5guCJhgwNCAqxNFi-2oyW/Caution.gif" alt="Caution" /><span class="style2"><strong> Caution</strong></span></th>
</tr>
<tr>
<td style="background-color: #f0f0f0;">As mentioned above you need to be<br />
careful when directly querying the Metaverse tables.If your system is already in production, and you happen to be adding in<br />
a new data source, then you may be better off employing a SQL MA to export<br />
the data you’re interested in to another table, where you can query it as<br />
much as you like without risk of locking errors.</td>
</tr>
</tbody>
</table>
<p>  </p>
<h2 style="color: #365f91; font-size: 14px; font-weight: bold;">Querying the Connector Space</h2>
<p>Unfortunately it is not so simple to query the connector space to, for example, report on that state of your disconnected objects.</p>
<p>It’s a great pity that you can’t just save results from the Joins page in the Identity Manager GUI, so your options are: </p>
<p><strong>SQL query</strong> &#8211; The CS table holds data differently to the Metaverse tables.</p>
<p>It is possible to query for disconnectors in this way, however you will only be able to retrieve the CN of objects – which may not be sufficient to identify them. </p>
<div style="background-color: #e6e6e6; width: 620px; overflow: scroll;">
<pre style="background-color: #e6e6e6; font-family: 'Courier New'; font-size: 11px;" lang="x-js">select cs.rdn from dbo.mms_connectorspace cs
join dbo.mms_management_agent ma
on cs.ma_id = ma.ma_id
left outer join dbo.mms_csmv_link mv
on mv.cs_object_id = cs.object_id
where ma.ma_name = 'My MA'
and mv.mv_object_id is null
and cs.connector_state = 0</pre>
</div>
<p><strong>CSExport</strong> &#8211; The command-line utility csexport.exe, found in the &lt;ILM program&gt;\bin folder, will allow you to dump connector space objects to an XML file. </p>
<p><strong>Report directly from the data source</strong> &#8211; Once an object in the data source has been correctly identified you will ideally export a unique attribute out to it. It may then be possible to identify the non-joined objects as those which don’t possess this attribute. </p>
<p><strong>Project to a different object type</strong> &#8211; ILM processes joins before projections, so it is fairly simple to project all non-joined objects to a different Metaverse object type – for example, one called “disconnectors”. This may help in reporting on an overall status direct from the Metaverse tables.</p>
<p>Note however that to make these objects once again available for joins they will have to be disconnected from the MVExtension provisioning code. </p>
<h2 style="color: #365f91; font-size: 14px; font-weight: bold;">Advanced Tips and Tricks</h2>
<p style="color: #365f91; font-size: 14px; font-weight: bold;">Join to Multi-value Attribute</p>
<p>Sometimes you may need to join to a value in a multi-value attribute. An example is searching through all the <em>proxyAddresses</em> for a match against<br />
a single email address. </p>
<p>When the multi-valued attribute exists in the connector space, and the single valued attribute is in the Metaverse, this is very easily accomplished. Just use an Advanced Join Rule to break the multi-valued attribute down into the values list used by the join rule. </p>
<div style="background-color: #e6e6e6; width: 620px; overflow: scroll;">
<pre style="background-color: #e6e6e6; font-family: 'Courier New'; font-size: 11px;" lang="x-js"> Public Sub MapAttributesForJoin(ByVal FlowRuleName As String, ByVal csentry As CSEntry, ByRef values As ValueCollection) Implements IMASynchronization.MapAttributesForJoin
<span lang="en-us">   </span>Select FlowRuleName
<span lang="en-us">      </span>Case "Join_proxyAddresses"
<span lang="en-us">         </span>Dim alias As String
<span lang="en-us">         </span>For Each alias In csentry("givenName").Values
<span lang="en-us">   </span> <span lang="en-us">  </span> <span lang="en-us">  </span> <span lang="en-us">  </span>values.Add(alias)
<span lang="en-us">         </span>Next
<span lang="en-us">   </span>End Select
End Sub</pre>
</div>
<p>However, when the multi-valued attribute has already been imported into the Metaverse you will have a problem. While you can join on a multi-valued attribute, you have to join on the whole thing. There is no way that you can match one value out of a multi-valued Metaverse attribute against a single-valued connector space attribute. </p>
<p>Some possible options: </p>
<ul>
<li>Import the multi-valued attribute into a series of single-valued attributes in the Metaverse, eg., proxy1, proxy2, proxy3 …</li>
<li>Use a different Metaverse object type to do the project and join the other way around.</li>
</ul>
<h3 style="color: #365f91; font-size: 13px; font-weight: bold;">Multiple Possibilities in the Connector Space</h3>
<p>All the joining techniques so far have been based around a single connector space object, with one or more possible matches in the Metaverse. But what do you do if you want to work the other way around, where there are multiple possible matches in the connector space for a single Metaverse object, and you want to pick the best one? Unfortunately this is not straight-forward. There is no way to offer a selection of connector space objects in a join rule, as joins always work on a single connector space object at a time. You can judge the merits of the current CS object, but you can’t tell if there’s a better one coming up. One way around this is to do everything with CSV files. </p>
<ol>
<li>Use the ResolveJoinSearch to write possible joins to a CSV, but don’t actually join anything,</li>
<li>Do your matching outside ILM, then</li>
<li>Use a CSV with an Advanced Join Rule to make the joins.</li>
</ol>
<h3 style="color: #365f91; font-size: 13px; font-weight: bold;">Too much data</h3>
<p>If you have an enormous number of accounts, and different data sources to trawl through, you may be best off doing your data matching outside of ILM, and then just using the CSV join rule above to make the joins.  Check out the Fuzzy Lookup Transformation from the Enterprise version of SQL SSIS for help here. </p>
<h2 style="color: #365f91; font-size: 14px; font-weight: bold;">Take-Home Thoughts</h2>
<ul>
<li>Complex join rules are a means to an end – not the end itself.</li>
<li>Breadcrumbing is essential for automation.</li>
<li>When matching on weak rules (eg., surname only) then verify the match another way.</li>
<li>You can’t do it all in ILM. CSV, Excel and fuzzy lookup algorithms will also help, but an element of by-hand matching is inevitable.</li>
<li>Get the matching and breadcrumbing sorted out before you start flowing and provisioning.This will make for a happier project, stake holders, users and YOU!</li>
</ul>
<h2 style="color: #365f91; font-size: 14px; font-weight: bold;">Extra Reading</h2>
<ul>
<li><a href="http://technet.microsoft.com/en-us/library/cc720664(WS.10).aspx">Design Concepts for Correlating Digital Identities</a></li>
<li><a href="http://download.microsoft.com/download/1/3/7/137d2f75-f95c-4aea-b553-a311203058cc/CorrectingJoins.doc">Correcting incorrect joins</a></li>
</ul>
<h2 style="color: #365f91; font-size: 14px; font-weight: bold;">About the Author</h2>
<p>Carol Wapshere is an ILM MVP and contributor of a few of these documents now. She has always believed that putting the work in up-front will save you lots of headaches in the long run. It’s a self-defense strategy really – there’s nothing worse than having to go over and over (and over) the same ground again and again, especially when you’d already moved on to something new and far more interesting. Keep it neat, and keep it simple, and things should work just fine. </p>
<p>Thanks to Markus Vilcinskas and Paul Loonen for their help with this document.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/phase-one-joins-and-data-matching/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>ConnectionChangeTime</title>
		<link>http://www.wapshere.com/missmiis/connectionchangetime</link>
		<comments>http://www.wapshere.com/missmiis/connectionchangetime#comments</comments>
		<pubDate>Thu, 25 Feb 2010 18:25:22 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[MIIS 2003]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=683</guid>
		<description><![CDATA[This got me out of a pickle today. A slip-up in a join rule caused hundreds of bad joins to be made. There were far too many to un-do by hand, but then I figured out I could add a few lines to the Provisioning Sub of the MVExtension to remove all the joins made [...]]]></description>
			<content:encoded><![CDATA[<p>This got me out of a pickle today. A slip-up in a join rule caused hundreds of bad joins to be made. There were far too many to un-do by hand, but then I figured out I could add a few lines to the Provisioning Sub of the MVExtension to remove all the joins made in the past hour:<br />
<code><br />
If mventry.ConnectedMAs(<em>Ma Name</em>).Connectors.Count &gt; 0 _<br />
AndAlso DateDiff(DateInterval.Hour, mventry.ConnectedMAs(<em>Ma Name</em>).Connectors.ByIndex(0).ConnectionChangeTime, Now) &lt; 1 Then<br />
  mventry.ConnectedMAs(<em>Ma Name</em>).Connectors.ByIndex(0).Deprovision()<br />
End If</code></p>
<p>Handy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/connectionchangetime/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Account Deprovisioning Scenarios</title>
		<link>http://www.wapshere.com/missmiis/account-deprovisioning-scenarios</link>
		<comments>http://www.wapshere.com/missmiis/account-deprovisioning-scenarios#comments</comments>
		<pubDate>Tue, 26 Jan 2010 12:57:53 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=671</guid>
		<description><![CDATA[
I just posted this article in the Greatest Hits series of the ILM Technet forum. It describes some of the methods and considerations around disabling and deleting users accounts with ILM.

In Identity Management, deprovisioning is every bit as important as provisioning – in fact the security guys would say it is more important.
End-of-life management may [...]]]></description>
			<content:encoded><![CDATA[<p><!--Start Here --></p>
<p>I just posted this article in the Greatest Hits series of the ILM Technet forum. It describes some of the methods and considerations around disabling and deleting users accounts with ILM.</p>
<p><span id="more-671"></span></p>
<p>In Identity Management, deprovisioning is every bit as important as provisioning – in fact the security guys would say it is more important.</p>
<p>End-of-life management may have been one of the determining factors that got the IdM project started in the first place – while most<br />
organizations have a variety of scripts and processes they use to create accounts and assign permissions, the cleanup when a person leaves is often not handled so well.</p>
<p>General rules for object deletion have been already well covered in Markus’ article<br />
<a href="http://social.technet.microsoft.com/Forums/en-US/identitylifecyclemanager/thread/603c4f8c-d782-4625-a045-009d15ed0f3b" target="_blank">Understanding Deletions in ILM</a>; however there is more that can be said on the subject of user accounts, for which an immediate delete is often not appropriate.</p>
<p>This article shows how you can use ILM to configure a flexible deprovisioning solution that is customized to your technical, organizational and compliance needs.</p>
<h2>Account Deprovisioning Scenarios in this document</h2>
<p>We are going to look at the following types of account deprovisioning:</p>
<ol>
<li>Simple deletion</li>
<li>Disabling the account</li>
<li>Deleting the account on a time-delayed basis</li>
<li>Stopping ILM from managing the account without actually deleting it (disconnection)</li>
</ol>
<h2>Parts to the Account Deprovisioning Puzzle</h2>
<p>Depending on your needs, you will most likely have to piece together a number of different elements to achieve the desired result.</p>
<p><strong>Account Disabling:</strong></p>
<p>Deactivating an object normally involves changing one or more of its attributes (eg.: setting userAccountControl on an AD user), and the usual way to do this is with an export attribute flow (EAF).</p>
<p>See code example “<em><a href="#Disabling Flow Rules">Disabling Flow Rules</a></em>” below.</p>
<p><strong>Moving deactivated accounts:</strong></p>
<ul>
<li>A common practice is to put disabled accounts in a particular place, such as a “<em>Disabled</em>” OU.For AD this is a &#8220;<em>Rename</em>&#8221; activity, and is typically done in the metaverse<br />
extension code.</li>
<li>For the “<em>Stop management</em>” scenario it is also possible to move the account just prior to disconnecting it in the MA Extension Deprovision method.</li>
</ul>
<p>See code example “<em><a href="#Metaverse Deprovisioning">Metaverse Deprovisioning</a></em>” below.<br />
 </p>
<p><strong>Deleting the connector space (CS) object:</strong></p>
<ul>
<li>The first step to deleting an account is to delete the object that represents it in the connector space.This can happen in one of the following two ways:
<ul>
<li>The joined Metaverse object is deleted</li>
<li>The joined Metaverse object was disconnected, either manually or by using the<br />
<em>CSEntry.Deprovision()</em> method in the<br />
metaverse extension code.</li>
</ul>
</li>
<li>In both cases a deletion will only happen if the &#8220;<em>Configure Deprovisioning</em>&#8221; tab on the MA configuration has been set as follows:
<ul>
<li>“<em>Stage a delete on the object for the next export run</em>”, or</li>
<li>“<em>Determine with a rules extension</em>” AND the rules extension code returns<br />
<em>DeprovisionAction.Delete</em>.</li>
</ul>
</li>
</ul>
<p> <br />
See code example “<em><a href="#MA Deprovision Sub">MA Deprovision Sub</a></em>” below<br />
 <br />
See “<em><a href="#Metaverse Deprovisioning">Metaverse Deprovisioning</a></em>” for an example of the <em>CSEntry.Deprovision()</em> method.<br />
 </p>
<p><strong>Deleting the account in the connected data source (CDS):</strong></p>
<ul>
<li>To delete the actual object in the CDS, we must first delete the connector space object using the methods above, after which we should find an export of type “<em>delete</em>” ready in the connector space.It is then just a matter of running an Export.
<ul>
<li>Note that the account used by the MA must have permission to delete objects of this type in the CDS.</li>
<li>Note also that if the MA is of type “Extensible Connectivity” you must write a Delete method in the Connected Data Source extension (see example below).</li>
</ul>
</li>
</ul>
<p> <br />
See code example “<a href="#XMA Delete Method">XMA Delete Method</a>” below.<br />
 </p>
<p><strong>Time dependant deletion:</strong></p>
<ul>
<li>Sometimes you want to delete an object on a certain date – perhaps an expiration date, or 3 months after the account was disabled.To do this you need the date available on the Metaverse object, which means you have to flow it into the Metaverse from somewhere.
<ul>
<li>An example for AD accounts is to use a spare attribute on the account, such as info or one of the extensionAttributes, to write the date at the same time as you disable the account.Flow this value back into the Metaverse and the information will be available.</li>
</ul>
</li>
</ul>
<p> <br />
See code example “<a href="#Metaverse Deprovisioning">Metaverse Deprovisioning</a>” below.<br />
 </p>
<h2>Deprovisioning Scenarios</h2>
<h3>Simple Deprovision based on disappearance</h3>
<p>The simplest deprovisioning scenario, and the one that can be executed without writing any code, is the “disappearance” scenario.</p>
<p>Here an object (or database line, or text file line) disappears from a source MA and is imported as a delete.</p>
<p>In the Metaverse we have configured our Object Deletion Rule as “<em>Delete Metaverse object when connector from this management agent is disconnected</em>” and selected our source MA.</p>
<p>Finally we have configured our other MAs to delete the CS objects when the Metaverse object is deleted.</p>
<p>In this way we could, for example, delete an AD account because the person’s record disappeared from the HR data source.</p>
<blockquote><p><strong>Caution: This method may lead to unexpected loss of accounts, temper and job!</strong></p></blockquote>
<p>As a general rule, it is a bad idea to make destructive decisions based on an absence of information. All sorts of errors, both human and machine, could happen to cause data to be unavailable at the time an Import runs. If you do use this simple approach, only use it for low-priority objects that can be deleted and recreated without much impact.</p>
<h3>Deprovision based on attribute change</h3>
<p>It is a much better practice to make deprovisioning decisions based on positive data.</p>
<p>So, with the HR data source, we continue to import resigned people, but with a status flag that indicates they are now inactive.</p>
<p>We then write some code in the metaverse extension which reacts to the person’s “inactive” status.</p>
<p>The great advantage to this method is the flexibility it gives us.</p>
<p>For example, we may deal with the person’s connected objects in different ways, deleting contacts and application accounts immediately<br />
but, just disabling the AD user account until further notice.</p>
<p>Deprovisioning a connector space object from metaverse extension code is trivial – all you have to do is add the line</p>
<p><em>CSEntry.Deprovision()</em></p>
<p>The bulk of the code before this will be spent in testing attribute values, and connections to different MAs, to determine when conditions are right to issue this command.</p>
<h3>Disable then delete</h3>
<p>It is simple enough to disable an account using an EAF (see example “<a href="#Disabling Flow Rules">Disabling Flow Rules</a>” below).</p>
<p>You could also move the account to a special location (see example “<a href="#Metaverse Deprovisioning">Metaverse Deprovisioning</a>” below).</p>
<p>However what do you do if you want to remove the account at some point in the future?</p>
<p>The first thing to be aware of is you must not delete the metaverse object.</p>
<p>To be able to delete the disabled account in the future it has to be connected to something in the<br />
metaverse.</p>
<p>ILM can only manage connectors.</p>
<p>Next, you will need some kind of <em>datestamp</em> on the metaverse object so your<br />
metaverse extension code will know when it’s OK to delete the account.</p>
<p>The only way to write a value to a metaverse object is with an IAF – so this implies writing the<br />
<em>datestamp</em> outside ILM, on a CDS object, and then importing it back in.</p>
<p>The method in the code examples below works like this:</p>
<ol>
<li>Based on the status attribute in the Metaverse, I export the <em>userAccountControl</em> to disable the AD user account,</li>
<li>Based on the same rules, I also export today’s date to the user’s info attribute,</li>
<li>II import info back to a metaverse attribute called <em>disableDate</em>,</li>
<li>I can then use <em>disableDate</em> in my metaverse extension to decide when the time is right to issue a CSEntry.Deprovision().</li>
</ol>
<p>There are a couple of points to note about this method:</p>
<ul>
<li>While disables will happen on a delta sync, deletions will only happen on a<br />
full sync.</li>
<li>The CDS attribute used to hold the date could be modified in the CDS (though you can use this to your advantage if you want to extend the disabled life of an account).</li>
</ul>
<h3>Stop Managing an Object</h3>
<p>In some cases object deletion is handled in the CDS itself and all you need to do is to stop managing the object.</p>
<p>In ILM terminology the object becomes a “disconnector” and, while it may still exist in the MA’s connector space, it is no longer connected to a Metaverse object, and ILM can no longer impact it in any way.</p>
<p>To disconnect rather than delete you actually use exactly the same CSEntry.Deprovision() method, but with the correct option selected on your MA’s Configure Deprovisioning page.</p>
<p>You could choose to:</p>
<ul>
<li>“Make them disconnectors”. The object is disconnected but remains in the CS and CDS.It will be reassessed for possible joins at each Full Sync,</li>
<li>“Make them explicit disconnectors”.Like the above, but it will not be reassessed for possible joins, or</li>
<li>Decide with a Rule Extension (see example “<a href="#MA Deprovision Sub">MA Deprovision Sub</a>” below).</li>
</ul>
<p>The “explicit” option needs a bit more discussion.</p>
<p>If ever you delete and re-import the CS all “<em>explicit</em>” tags will be lost and the objects become regular disconnectors again, and available for joins.</p>
<p>This option should only be chosen in particular circumstances, such as when there is a regular and reliable deletion of redundant objects happening in the CDS.</p>
<p>If you are sure that you will not need to rejoin to an object once it has been disconnected then another idea is to export a blocking attribute before disconnecting.</p>
<p>For example you export the string “<em>Unmanaged</em>” to an attribute on the CDS object, and only disconnect it once the attribute value is confirmed.</p>
<p>You can then use this attribute in a Connection Filter to prevent future re-connections.</p>
<h2>Some Common Problems and Questions</h2>
<h3>I staged some Deletes but I don’t want to export them now</h3>
<p>Perhaps there was an error in your code or your import data and you have a bunch of Deletes waiting to go out – but you really don’t want to do that!</p>
<p>Even after correcting the code and re-syncing you may find they turn into Delete-Adds – these should also not be exported as the actual CDS objects will be deleted and recreated – not great for AD accounts!</p>
<p>Unfortunately, the only full-proof fix in this case is a delete and re-import of the connector space.</p>
<h3>I have some old accounts with no HR reference – will ILM delete them?</h3>
<p>ILM can only delete objects that it is connected to, so if it never connected to the object it can never delete it.</p>
<p>If you plan to tidy up unmanaged objects in your CDS then have a look at the tool csexport.exe (from the MIIS\bin folder) which can be used to export lists of disconnectors.</p>
<h3>How can I block an Export if there are too many Disables?</h3>
<p>The Export run profile contains an option to stop the job if there are more than a certain number of Deletes queued to go out.</p>
<p>Unfortunately it is not possible to do something similar for disables with native functionality.</p>
<p>If something like this is needed then it should be possible to increment a count in a file from the EAF which deactivates the account, and then modify the script which runs the Export profile to first check the count.</p>
<h3>Sideways Joins</h3>
<p>A scenario you need to watch out for is what I call a “<em>sideways join</em>”.</p>
<p>Take a situation where the “<em>person</em>” object type has one source MA (eg.: HR) and multiple target MAs (AD, Notes, some other applications).</p>
<p>The source object has been deleted, but one or more of the target objects have remained and are still joined to a<br />
metaverse object.</p>
<p>The problem here is that these objects won’t show up in lists of disconnectors and so can remain, unobserved, for some time.</p>
<p>If deprovisioning logic is based on a value from the source MA then, in a default configuration, this value would have been recalled and is no longer present on the Metaverse object – so your code is probably just skipping it.</p>
<p>When writing your metaverse extension code, it is a good idea to test for unexpected situations – like an object with no connector in the primary source MA – and then throw an error or otherwise deal with the object.</p>
<h3>I can see Deletes staged in the connector space, but the objects don’t get deleted in the external system</h3>
<p>First, look for error messages in Identity Manager and in the Event Log that may indicate the problem.</p>
<p>Make sure the account used by the MA has the correct permissions in the CDS.</p>
<p>If it’s an “<em>Extensible Connectivity</em>” MA, check that a Delete method has been written in the Connected Data Source Extension.</p>
<h3>I disabled an AD user – now how do I remove it from groups?</h3>
<p>This is one with no short answer.</p>
<p>You cannot manage the <em>memberOf</em> attribute on AD users as it is a backlinked attribute.</p>
<p>So group membership can only be managed through the member attribute of groups.</p>
<p>This is fine if you are already managing AD groups with ILM – but not ok if they are managed manually in AD.</p>
<p>One of the reasons to keep an account in a disabled state for a while is to allow it to be restored quickly with all its previous rights intact – so removing it from groups may not be the best idea anyway.</p>
<p>If it is necessary then the choices are to fully take over group management with ILM, or to write a script that removes disabled users from groups, and is run outside of ILM.</p>
<h2>Code Examples</h2>
<h3>MA Deprovision Sub</h3>
<p><a name="MA Deprovision Sub">In</a> this example, when the Metaverse object is deleted or disconnected, accounts in the “<em>Student</em>” OU are deleted while accounts in the “<em>Staff</em>” OU become disconnectors.</p>
<p>This sub is located in the Management Agent Extension code.</p>
<pre lang="x-js">Public Function Deprovision(ByVal csentry As CSEntry) As DeprovisionAction Implements IMASynchronization.Deprovision
   If csentry.DN.ToString.Contains("OU=Students") Then
      Return DeprovisionAction.Delete
   ElseIf csentry.DN.ToString.Contains("OU=Staff") Then
      ' Optionally, rename the cs object or change attributes
      ' just prior to disconnecting
      Return DeprovisionAction.Disconnect
   Else
      Throw New UnexpectedDataException("DN does not contain " _
      &amp; "'OU=Staff' or 'OU=Students' so I don't know " _
      &amp; "which deprovision action to perform.")
   End If
End Function</pre>
<h3>Metaverse Deprovisioning</h3>
<p><a name="Metaverse Deprovisioning">In</a> this example we use the user’s status attribute in the Metaverse to decide if the account should be moved to a “<em>Disabled</em>” OU.</p>
<p>(The actual account disabling is done by an EAF and the <em>disableDate</em> and<br />
<em>userAccountControl</em> are flowed back by IAFs – see below.)</p>
<p>We then use the <em>disableDate</em> attribute on the metaverse object to decide when to perform the final deletion.</p>
<p>This example subroutine has been called from <em>Sub Provision</em> which is located in the Metaverse Extension code.</p>
<pre lang="x-js">Private Sub User_Provisioning(ByVal mventry As MVEntry)
   Dim ADMA As ConnectedMA = mventry.ConnectedMAs("MyDomain")
   Dim expectedDN As ReferenceValue
   Dim ShouldExist As Boolean
   Dim DoesExist As Boolean
   Const OU_USERS As String = "OU=Users,OU=MyOrg,DC=mydomain,DC=com"
   Const OU_DISABLED As String = "OU=Disabled,OU=Users,OU=MyOrg,DC=mydomain,DC=com"
   Const KEEP_DISABLED_DAYS As Integer = 90

   '' Should the account exist?
   '' Inactive accounts should exist for KEEP_DISABLED_DAYS after being disabled.
   If mventry("status").IsPresent AndAlso mventry("status").StringValue = "Active" Then
      ShouldExist = True
   Else
      ShouldExist = False

      If MVEntry("userAccountControl").IsPresent AndAlso _
         MVEntry("disableDate").IsPresent Then

         If (MVEntry("userAccountControl").IntegerValue And ADS_UF_ACCOUNTDISABLE) = _
             ADS_UF_ACCOUNTDISABLE Then

            'Account disabled – allow to exist until deletion date
            ShouldExist = True

            Dim disabledDate As DateTime
            disabledDate = Convert.ToDateTime(MVEntry("disableDate").StringValue)
            If Now.Subtract(disabledDate).Days &gt; KEEP_DISABLED_DAYS Then
               ShouldExist = False
            End If
         Else
            'Account enabled
            ShouldExist = True
         End If
      End If
   End If
   '' Check if the AD account already exists
   Select Case ADMA.Connectors.Count
      Case 0
         DoesExist = False
      Case 1
         DoesExist = True
      Case Else
         Throw New UnexpectedDataException("Multiple connectors in MA " &amp; ADMA.Name)
   End Select

   '' Generate the expected DN for the user - to use in renaming or moving
   Dim RDN As String = "CN=" &amp; mventry("displayName").StringValue

   If mventry("status").StringValue = "Active" Then
      expectedDN = ADMA.EscapeDNComponent(RDN).Concat(OU_USERS)
   Else
      expectedDN = ADMA.EscapeDNComponent(RDN).Concat(OU_DISABLED)
   End If

   '' Take action based on values of ShouldExist and DoesExist

   If ShouldExist And DoesExist Then
      'Check if account should be renamed or moved
      Dim CSEntry As CSEntry = ADMA.Connectors.ByIndex(0)
      If CSEntry.DN.ToString.ToLower &lt;&gt; expectedDN.ToString.ToLower Then
         CSEntry.DN = expectedDN
      End If

   ElseIf ShouldExist And Not DoesExist Then
      'Provision Account
      &lt;...&gt;

   ElseIf Not ShouldExist And DoesExist Then
      'Deprovision Account
      CSEntry.Deprovision()

   End If
 End Sub</pre>
<h3>Disabling Flow Rules</h3>
<p><a name="Disabling Flow Rules">With</a> these flow rules I disable an AD account and also write a date onto the object (I’m using info but you can use any free attribute) to indicate when it was disabled.</p>
<p>I also flow <em>userAccountControl</em> and info back into the metaverse so I have access to the values in my<br />
metaverse extension code (above).</p>
<p><img src="http://public.bay.livefilestore.com/y1p--wnV_K-shH6tRb6q_v9QW6CK8ju5SvYrGmyGW6MnVhzsHhYziWODyCHvP4kcrnF3HUmReTUud6NEi7hpFdUXw/DP01.jpg" alt="" width="572" height="234" /></p>
<pre lang="x-js">Public Sub MapAttributesForExport(ByVal FlowRuleName As String, ByVal mventry As MVEntry, ByVal csentry As CSEntry) Implements IMASynchronization.MapAttributesForExport

   Const ADS_UF_NORMAL_ACCOUNT As Long = &amp;H200
   Const ADS_UF_ACCOUNTDISABLE As Long = &amp;H2

   Select Case FlowRuleName

      Case "export_userAccountControl"
         Dim currentValue As Long

         If csentry("userAccountControl").IsPresent Then
            currentValue = csentry("userAccountControl").IntegerValue
         Else
            currentValue = ADS_UF_NORMAL_ACCOUNT
         End If

         If mventry("status").IsPresent AndAlso mventry("status").Value = "Active" Then
            ' Enable account
            csentry("userAccountControl").IntegerValue = _
            (currentValue Or ADS_UF_NORMAL_ACCOUNT) And (Not ADS_UF_ACCOUNTDISABLE)

         Else
            ' Disable account
            csentry("userAccountControl").IntegerValue = _
            currentValue Or ADS_UF_ACCOUNTDISABLE
         End If

      Case "export_info"
         If mventry("status").IsPresent AndAlso mventry("status").Value = "Active" _
            AndAlso csentry("info").IsPresent Then
            csentry("info").Delete()
         ElseIf mventry("status").Value = "Inactive" AndAlso _
            Not csentry("info").IsPresent Then
            csentry("info").StringValue = Now.ToString
         End If

      End Select
End Sub</pre>
<h3>XMA Delete Method</h3>
<p><a name="XMA Delete Method">For</a> an MA of type “<em>Extensible Connectivity</em>” you need to write your own routines for the export types<br />
<em>Add</em>, <em>Modify</em> and <em>Delete</em>.</p>
<p>This example shows the <em>Delete</em> step for an XMA which manages home folders for user accounts.</p>
<p>The sub is found in the <em>Connected Data Source Extension</em>.</p>
<p>This example is a very simple deletion of the folder, but you could easily add extra code to, for example, move the folder to an archive location.</p>
<p>(If you want to see an example of the Add method see my blog:<br />
<a href="http://www.wapshere.com/missmiis/creating-user-home-directories-windows-version" target="_blank">Creating Home Directories</a>)</p>
<pre lang="x-js"> Public Sub ExportEntry(ByVal modificationType As ModificationType, ByVal changedAttributes As String(), ByVal csentry As CSEntry) Implements IMAExtensibleCallExport.ExportEntry

If modificationType = Microsoft.MetadirectoryServices.ModificationType.Add Then
' Create the folder

ElseIf modificationType = _
Microsoft.MetadirectoryServices.ModificationType.Delete Then
System.IO.Directory.Delete(csentry("path").StringValue, True)
End If

End Sub</pre>
<h2>About the Author</h2>
<p>Carol Wapshere has been working in IT since 1990, and has since worked in many different organizations, across four different countries. She started out in Netware then moved into Microsoft server products, picking up an assortment of skills in other non-Microsoft systems along the way. She first started working with MIIS in 2005 and loved how it could be used to tie together disparate systems, bringing in much-needed order, and making lots of tedious jobs just disappear.</p>
<p>Thanks to Markus Vilcinskas and Peter Geelen for their help with this document.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/account-deprovisioning-scenarios/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More KISS tips</title>
		<link>http://www.wapshere.com/missmiis/more-kiss-tips</link>
		<comments>http://www.wapshere.com/missmiis/more-kiss-tips#comments</comments>
		<pubDate>Sat, 01 Nov 2008 07:08:41 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[newbie]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=231</guid>
		<description><![CDATA[In this post I discussed some ways to simplify an MIIS/ILM installation, with a view to making it more efficient and easier to troubleshoot and maintain. I have a few more points for the list. 
A Recap
So far on my list I had:

Use MVRouter to separate provisioning for different MAs.
A simple, and consistent, outline for [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.wapshere.com/missmiis/?p=181">this post</a> I discussed some ways to simplify an MIIS/ILM installation, with a view to making it more efficient and easier to troubleshoot and maintain. I have a few more points for the list. <span id="more-231"></span></p>
<h3>A Recap</h3>
<p>So far on my list I had:</p>
<ol>
<li>Use MVRouter to separate provisioning for different MAs.</li>
<li>A simple, and consistent, outline for the provisioning code.</li>
<li>Shift data generation away from advanced attribute flows and into SQL.</li>
<li>Remove complex join rules.</li>
</ol>
<p>And now some more&#8230;</p>
<h3>5. Minimise Metaverse Object Types</h3>
<p>Organisations will commonly have different types of people &#8211; users, perhaps split into internal and external, customers, contractors&#8230; It may initially seem to be a good idea to create different metaverse object types for each one. <em>Sometimes</em> there are good and unavoidable reasons for using seperate metaverse object types, but I maintain that in the <em>majority of cases</em> it is better to call them all <strong>person</strong>, and then use their attributes to differentiate between them.</p>
<blockquote><p>Newbie clarification: Just because they&#8217;re all one object type in the metaverse does not mean they have to be the the same object type in the connected directories. There is no problem with, for example, creating some as users and some as contacts, depending on their attributes.</p></blockquote>
<p>There are all sorts of advantages to this approach:</p>
<ul>
<li>Metaverse searches are simpler (and remember, &#8220;simpler&#8221; means &#8220;easier to explain to other people so they can find what they need themselves and quit bugging you&#8221;).</li>
<li>You can move more quickly when a new application comes along that needs a different combination of person types, perhaps even everyone in the system &#8211; one object type means one provisioning instruction and one set of flow rules.</li>
<li>If there is any possibility of people switching from one type to another it will be very straight forward, with no need to delete and recreate objects.</li>
</ul>
<h3>6. Match Metaverse Attribute Names to CDS Attribute Names</h3>
<p>When I first started with MIIS, it took me a while to figure out that <a href="http://www.wapshere.com/missmiis/?p=16">it&#8217;s ok to delete the default metaverse attributes</a>. Now I will habitually try to name metaverse attributes to match their <em>primary source</em> or <em>primary destination attribute</em>. A flow rule like this: staffnum -&gt; staffnum -&gt; employeeid is easier to remember than staffnum -&gt; uid -&gt; employeeid Once you have hundreds of flows like this you will be glad you went for some level of consistency (and so will the person who has to pick through the system after you&#8217;ve moved on).</p>
<h3>7. Don&#8217;t use the default advanced flow rule names</h3>
<p>I hate the default rule names and I always change them. The convention I use is &#8220;import_&#8221; or &#8220;export_&#8221; followed by the name of the attribute at the end of that import or export flow. import_displayName export_proxyAddresses These names are much easier to remember and to pick out in your code. It&#8217;s also pretty obvious what they&#8217;re for, and I like obvious!</p>
<h3>8. Be consistent with your Run Profile names</h3>
<p>I must admit it kind of bugs me when I see one MA with &#8220;Full Import and Full Syncchronization&#8221;, while another has &#8220;Full Imp/Full sync&#8221; and a third has &#8220;FIFS&#8221;. I don&#8217;t care what names you use &#8211; just <em>make them the same across all MAs</em>! Again it&#8217;s easier for others to understand, easier for you to remember, and much easier when automating your run profiles with scripts or using <a href="http://www.wapshere.com/missmiis/?p=160">my ILM Scheduler service</a>.</p>
<h3>Always Keep It Simple, Stupid</h3>
<p>That should really be my Rule Number One, but I&#8217;m still short one here. Once I think of something else I&#8217;ll  make this list into a proper top ten.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/more-kiss-tips/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

