<?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; Logs</title>
	<atom:link href="http://www.wapshere.com/missmiis/category/ilm/logs/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wapshere.com/missmiis</link>
	<description>Adventures in identity management</description>
	<lastBuildDate>Fri, 10 Sep 2010 13:30:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Archiving the Import and Export Logs, and viewing them with a stylesheet</title>
		<link>http://www.wapshere.com/missmiis/archiving-the-import-and-export-logs-and-viewing-them-with-a-stylesheet</link>
		<comments>http://www.wapshere.com/missmiis/archiving-the-import-and-export-logs-and-viewing-them-with-a-stylesheet#comments</comments>
		<pubDate>Mon, 16 Aug 2010 14:49:58 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[FIM 2010]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=912</guid>
		<description><![CDATA[A long time ago I wrote up a method that could be used to archive the MIIS import and export logs, while also making them more readable with a stylesheet. I&#8217;ve now implemented this on a FIM 2010 server, and it works, so I&#8217;m going to write it up again. The Problem The FIM Sync [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://www.wapshere.com/missmiis/a-stylesheet-for-the-import-and-export-logs">long time ago</a> I wrote up a method that could be used to archive the MIIS import and export logs, while also making them more readable with a stylesheet. I&#8217;ve now implemented this on a FIM 2010 server, and it works, so I&#8217;m going to write it up again.<span id="more-912"></span></p>
<h3>The Problem</h3>
<p>The FIM Sync Service, just like its predecessors, only stores information about the current state of objects. Run History is almost completely worthless and <a href="http://social.technet.microsoft.com/Forums/en-US/ilm2/thread/7e60ec1f-939c-4475-bfb9-01e739b8e5fc">should be cleared regularly</a>. However there will be times when you will be asked to trace through a series of events &#8211; perhaps leading to the CEO&#8217;s account being inadvertently disabled. At times like this it is important to be able to show that FIM was just responding appropriately to an imported data change, and not acting maliciously in some skynet-esque awakening.</p>
<p>However, as we know, the import and export run profiles, while allowing a log file to be dumped, then helpfully overwrite it at the next run. We need a way to hang on to that historical data.</p>
<h3>The Proposal</h3>
<p>If you&#8217;re already running your tasks using vbscripts it&#8217;s pretty simple to add an extra step which copies the log file off to a datestamped version in an archive location (script below).</p>
<p>At the same time, we can do a little manipulation to the log file to make it more readable. By inserting a couple of lines in the top of the log file it can now be used with an XML Stylesheet, allowing it to be browsed in a nice table format.</p>
<h3>Provisos</h3>
<p>The log file will only be archived if you run your export and import jobs via your scripts. Anything run directly from the Sync Service GUI may still produce a log file, but it won&#8217;t be archived.</p>
<p>Also, the timestamp is a approximate as it represents the time the log was archived, rather than the exact time specific objects were modified in a target directory. But if you archive the log straight after the Export profile runs then it should be close enough for most purposes.</p>
<h3>log.xsl</h3>
<p>First, you need to create a folder somewhere with the same sub-folders as your MaData folder (in the script example below, I&#8217;m using D:\FIM\MALogArchives). Then, into this new folder, create a text file called &#8220;log.xsl&#8221; and paste in the following content.<br />
<code></p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
&lt;xsl:template match="/"&gt;
  &lt;html&gt;
  &lt;body&gt;
    &lt;h2&gt;&lt;xsl:value-of select="top/xmlfile-time" /&gt;&lt;/h2&gt;
    &lt;table border="1"&gt;
      &lt;tr bgcolor="#0066FF"&gt;
        &lt;th&gt;Operation&lt;/th&gt;
        &lt;th&gt;DN&lt;/th&gt;
        &lt;th&gt;Attributes&lt;/th&gt;
      &lt;/tr&gt;
      &lt;xsl:for-each select="top/delta"&gt;

        &lt;!-- Start a Row --&gt;
      &lt;tr&gt;

  &lt;!-- Operation and DN Columns --&gt;
         &lt;xsl:choose&gt;
         &lt;xsl:when test = "@newdn"&gt;
           &lt;td&gt;&lt;font size="2"&gt;rename&lt;/font&gt;&lt;/td&gt;
           &lt;td&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@dn" /&gt;&lt;br&gt;&lt;/br&gt;&lt;xsl:value-of select="@newdn" /&gt;&lt;/font&gt;&lt;/td&gt;
         &lt;/xsl:when&gt;
         &lt;xsl:otherwise&gt;
           &lt;td&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@operation" /&gt;&lt;/font&gt;&lt;/td&gt;
           &lt;td&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@dn" /&gt;&lt;/font&gt;&lt;/td&gt;
         &lt;/xsl:otherwise&gt;
        &lt;/xsl:choose&gt;

  &lt;!-- Attributes Column --&gt;
        &lt;td&gt;
        &lt;table border="0"&gt;

          &lt;!-- attributes --&gt;
        &lt;xsl:for-each select="dn-attr"&gt;
        &lt;tr&gt;

          &lt;!-- Multi-valued --&gt;
         &lt;xsl:if test = "@multivalued='true'"&gt;
            &lt;xsl:choose&gt;
            &lt;xsl:when test = "attr/@operation='add'"&gt;
              &lt;td bgcolor="#CCFFCC"&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@name" /&gt; add&lt;/font&gt;&lt;/td&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test = "attr/@operation='delete'"&gt;
              &lt;td bgcolor="#CC6666"&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@name" /&gt; delete&lt;/font&gt;&lt;/td&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:otherwise&gt;
              &lt;td bgcolor="#CCCCFF"&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@name" /&gt;&lt;/font&gt;&lt;/td&gt;
            &lt;/xsl:otherwise&gt;
            &lt;/xsl:choose&gt;

            &lt;td&gt;
              &lt;xsl:for-each select="dn-value"&gt;
                &lt;table border="0"&gt;
                  &lt;xsl:choose&gt;
                  &lt;xsl:when test = "@operation='delete'"&gt;
                    &lt;tr&gt;&lt;td&gt;&lt;font size="2"&gt;delete: &lt;xsl:value-of select="dn" /&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
                  &lt;/xsl:when&gt;
                  &lt;xsl:when test = "@operation='add'"&gt;
                    &lt;tr&gt;&lt;td&gt;&lt;font size="2"&gt;add: &lt;xsl:value-of select="dn" /&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
                  &lt;/xsl:when&gt;
                  &lt;xsl:otherwise&gt;
                    &lt;tr&gt;&lt;td&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="dn" /&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
                  &lt;/xsl:otherwise&gt;
                  &lt;/xsl:choose&gt;
                &lt;/table&gt;
              &lt;/xsl:for-each&gt;
            &lt;/td&gt;
          &lt;/xsl:if&gt;

          &lt;!-- Single-valued --&gt;
           &lt;xsl:if test = "@multivalued='false'"&gt;
             &lt;td bgcolor="#CCCCFF"&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@name" /&gt;&lt;/font&gt;&lt;/td&gt;
             &lt;td&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="dn-value/dn" /&gt;&lt;/font&gt;&lt;/td&gt;
           &lt;/xsl:if&gt;

        &lt;/tr&gt;
        &lt;/xsl:for-each&gt;

        &lt;!-- Ordinary attributes --&gt;
        &lt;xsl:for-each select="attr"&gt;
        &lt;tr&gt;

          &lt;!-- Multi-value --&gt;
          &lt;xsl:if test = "@multivalued='true'"&gt;
            &lt;xsl:choose&gt;
            &lt;xsl:when test = "attr/@operation='add'"&gt;
              &lt;td bgcolor="#CCFFCC"&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@name" /&gt; add&lt;/font&gt;&lt;/td&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test = "attr/@operation='delete'"&gt;
              &lt;td bgcolor="#CC6666"&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@name" /&gt; delete&lt;/font&gt;&lt;/td&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:otherwise&gt;
              &lt;td bgcolor="#CCCCFF"&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@name" /&gt;&lt;/font&gt;&lt;/td&gt;
            &lt;/xsl:otherwise&gt;
            &lt;/xsl:choose&gt;

            &lt;td&gt;
              &lt;xsl:for-each select="value"&gt;
                &lt;table border="0"&gt;
                  &lt;xsl:choose&gt;
                  &lt;xsl:when test = "@operation='delete'"&gt;
                    &lt;tr&gt;&lt;td&gt;&lt;font size="2"&gt;delete: &lt;xsl:value-of select="." /&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
                  &lt;/xsl:when&gt;
                  &lt;xsl:when test = "@operation='add'"&gt;
                    &lt;tr&gt;&lt;td&gt;&lt;font size="2"&gt;add: &lt;xsl:value-of select="." /&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
                  &lt;/xsl:when&gt;
                  &lt;xsl:otherwise&gt;
                    &lt;tr&gt;&lt;td&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="." /&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
                  &lt;/xsl:otherwise&gt;
                  &lt;/xsl:choose&gt;
                &lt;/table&gt;
              &lt;/xsl:for-each&gt;
            &lt;/td&gt;
          &lt;/xsl:if&gt;

          &lt;!-- Single-valued --&gt;
          &lt;xsl:if test = "@multivalued='false'"&gt;
            &lt;xsl:if test = "@name!='unicodePwd'"&gt;
            &lt;xsl:if test = "@name!='msExchMailboxSecurityDescriptor'"&gt;
              &lt;td bgcolor="#CCCCFF"&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="@name" /&gt;&lt;/font&gt;&lt;/td&gt;
              &lt;td&gt;&lt;font size="2"&gt;&lt;xsl:value-of select="value" /&gt;&lt;/font&gt;&lt;/td&gt;
            &lt;/xsl:if&gt;
            &lt;/xsl:if&gt;
          &lt;/xsl:if&gt;

        &lt;/tr&gt;
        &lt;/xsl:for-each&gt;

        &lt;/table&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/xsl:for-each&gt;
    &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;

&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;</pre>
<p></code></p>
<h3>ArchiveLog.vbs</h3>
<p>Now here&#8217;s a vbscript that will copy the named log file, while modifying it to work with the stylesheet.</p>
<p><code>
<pre>
' This script copies the export and import logs to datestamped versions
' and modifies them to work with a stylesheet called ../log.xsl.
'
'   Usage: cscript archivelog.vbs MaName LogFileName
'
'   Eg:    cscript archivelog.vbs HR import.xml
'
' Written by Carol Wapshere

Option Explicit
Const XML_STYLESHEET = "..\log.xsl"
Const MIIS_FOLDER = "C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service"
Const ARCHIVE_FOLDER = "D:\FIM\MALogArchives"
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Const Unicode = -1

Dim objFS, MaName, LogName
Set objFS = CreateObject("Scripting.FileSystemObject")

If WScript.Arguments.Count &lt;&gt; 2 Then
  Usage
End If

MaName = WScript.Arguments.Item(0)
LogName = WScript.Arguments.Item(1)

ArchiveLog MaName, LogName

Sub ArchiveLog(MA, LogFile)

  Dim objLogFile, objArchiveFile
  Dim strLogName, strArchiveName, logTime, dateStamp, strLine

  strLogName = MIIS_FOLDER &#038; "\MaData\" &#038; MA &#038; "\" &#038; LogFile
  If objFS.FileExists(strLogName) Then
    logTime = Now()
    dateStamp = DatePart("yyyy", logTime) &#038; TwoChars("m", logTime) &#038;_
                                 TwoChars("d", logTime) &#038; TwoChars("h", logTime) &#038;_
                                 TwoChars("n", logTime) &#038; TwoChars("s", logTime)
    strArchiveName = ARCHIVE_FOLDER &#038; "\" &#038; MA &#038; "\" &#038; Split(LogFile,".")(0) &#038; "_" &#038; dateStamp &#038; ".xml"
    set objLogFile = objFS.OpenTextFile(strLogName, ForReading, false, Unicode)
    set objArchiveFile = objFS.OpenTextFile(strArchiveName, ForWriting, true, Unicode)
    objLogFile.ReadLine()
    objArchiveFile.WriteLine("&lt;?xml version=""1.0"" encoding=""UTF-16""?&gt;")
    objArchiveFile.WriteLine("&lt;?xml-stylesheet type=""text/xsl"" href=""" &#038; XML_STYLESHEET &#038; """?&gt;")
    objArchiveFile.WriteLine("&lt;top&gt;")
    objArchiveFile.WriteLine("&lt;xmlfile-time&gt;")
    objArchiveFile.WriteLine(logTime)
    objArchiveFile.WriteLine("&lt;/xmlfile-time&gt;")
    objLogFile.ReadLine() 'skip mmsml
    objLogFile.ReadLine() 'skip directory-entries
    strLine = objLogFile.ReadLine()
    Do Until InStr(strLine, "&lt;/directory-entries&gt;") &gt; 0
       objArchiveFile.WriteLine(strLine)
       strLine = objLogFile.ReadLine()
    Loop
    objArchiveFile.WriteLine("&lt;/top&gt;")
    objLogFile.Close()
    objArchiveFile.Close()
  End If
End Sub

Function TwoChars(dtvar, time)
  Dim i
  i = DatePart(dtvar, time)
  If i &lt; 10 Then
   TwoChars = "0" &#038; CStr(i)
  Else
   TwoChars = CStr(i)
  End If
End Function

Sub Usage
  Wscript.echo "Usage: cscript archivelog.vbs MaName import|export"
  Wscript.Quit
End Sub
</pre>
<p></code></p>
<h3>Modify the Run scripts</h3>
<p>Your last step is to modify your scheduled scripts to archive the import/export log directly after the task has run.</p>
<p><code>
<pre>
cscript AD_Export.vbs
cscript ArchiveLog.vbs "AD MA" export.xml
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/archiving-the-import-and-export-logs-and-viewing-them-with-a-stylesheet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubleshooting missing group member errors</title>
		<link>http://www.wapshere.com/missmiis/troubleshooting-missing-group-member-errors</link>
		<comments>http://www.wapshere.com/missmiis/troubleshooting-missing-group-member-errors#comments</comments>
		<pubDate>Thu, 04 Sep 2008 06:44:26 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[Groups]]></category>
		<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=166</guid>
		<description><![CDATA[In some implementations, it makes sense (usually by improving performance) to separate your user and group provisioning into seperate MAs. One downside of this approach, however, is that you can run into export errors when trying to update a group with a member who doesn&#8217;t exist in the external directory &#8211; and this includes delete [...]]]></description>
			<content:encoded><![CDATA[<p>In some implementations, it makes sense (usually by improving performance) to separate your user and group provisioning into seperate MAs. One downside of this approach, however, is that you can run into export errors when trying to update a group with a member who doesn&#8217;t exist in the external directory &#8211; and this includes delete member operations.</p>
<p>The error you will see will either be <strong>dn-attributes-failure</strong> or <strong>cd-missing-object</strong>, depending on the type of group.</p>
<p>The detailed error will say something about an add or delete operation on a member that does not exist but, unhelpfully, will not tell you which one.</p>
<p>I&#8217;ve had some fun and games with this one recently, so this post is about some ways I figured out to troubleshoot the problem, and includes a vbscript for finding that missing member.</p>
<p><span id="more-166"></span></p>
<h3>dn-missing.vbs</h3>
<p>While trying to troubleshoot these missing member errors during the week I wrote a quick vbscript to help &#8211; you can look at it <a href="http://www.wapshere.com/missmiis/?page_id=162">here</a>.</p>
<p>Basically it exports an XML copy of the group object from the connector space, and then attempts an LDAP bind against each member. This works for AD. I haven&#8217;t tried it for other directories, but I expect it would work with anything based on LDAP.</p>
<h3>What if the member exists?</h3>
<p>The big problem I was having was when the member actualy <em>did</em> exist in AD. This was very frustrating. It seemed that once ILM had decided it couldn&#8217;t export the group then nothing could convince it otherwise. I tried various mitigation techniques:</p>
<ul>
<li>Full Import Full Sync of everything (didn&#8217;t help),</li>
<li><a href="http://www.wapshere.com/missmiis/?p=154">Hacking the export.xml</a> (helped when I was having a problem with a member delete),</li>
<li>Adding the member manually in AD then doing a Delta Import Delta Sync (a bit pointless, but it got things moving again).</li>
</ul>
<p>A full clear-out and re-import of the connector space would doubtlessly have worked, but considering the number and size of the groups, this would have been a <a href="http://www.wapshere.com/missmiis/?p=121">painful process</a>.</p>
<h3>Targeting the same DC</h3>
<p>What I did eventually figure out was that the two MAs were targeting different DCs. Duh! Obviously, to avoid any missing objects due to AD sync delays, you should target the same DC.  In fact <a href="http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2124280&amp;SiteID=17">this post</a> on the Technet forum indicates that a Global Catalog server is best.</p>
<p>To hardcode a DC use the Domin controller connection settings on the Configure Directory Partitions tab of the AD MA.</p>
<h3>Remove users from groups before deleting the user account</h3>
<p>Another pretty obvious one, but I was also being careless on this front.</p>
<p>Even though it might seem perfectly reasonable to delete a non-existant user from a group, all AD will see is that you have explicity requested an operation involving something it can&#8217;t find.</p>
<p>In this implemetation, I disable users for a week before they are actually deleted. I now make sure that they are removed from all groups as soon as they are disabled.</p>
<p>I will write another post soon on the disable-delete methodology.</p>
<h3>DC Logging Levels</h3>
<p>Finally, if you are still having problems and need to get more information about why AD is rejecting an export, try increasing the logging levels on the DC as per this KB:</p>
<div dir="ltr"><a href="http://support.microsoft.com/kb/314980" target="_blank">http://support.microsoft.com/kb/314980</a></div>
<div dir="ltr"> </div>
<div dir="ltr">The ones to increase are 8, 9 and 16.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/troubleshooting-missing-group-member-errors/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking the import/export logs</title>
		<link>http://www.wapshere.com/missmiis/hacking-the-importexport-logs</link>
		<comments>http://www.wapshere.com/missmiis/hacking-the-importexport-logs#comments</comments>
		<pubDate>Mon, 25 Aug 2008 18:39:11 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[MIIS 2003]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=154</guid>
		<description><![CDATA[Here&#8217;s a trick that is worth knowing &#8211; though I&#8217;m only recommending it for TEST ENVIRONMENTS &#8211; consider yourself warned. You may have noticed the &#8221;test only&#8221; log file options on the import and export run profiles. Being able to stop the run at the log file is incredibly useful for testing what would have been exported, without [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a trick that is worth knowing &#8211; though I&#8217;m only recommending it for TEST ENVIRONMENTS &#8211; consider yourself warned.</p>
<p>You may have noticed the &#8221;test only&#8221; log file options on the import and export run profiles. Being able to stop the run at the log file is incredibly useful for testing what would have been exported, without actually going ahead and doing it. You can then resume the export from the log file &#8211; and if you wanted to, there is nothing to actually stop you editing that log file before resuming the run.</p>
<p><span id="more-154"></span></p>
<p><img src="http://www.wapshere.com/images/runprofile_import_logfile.GIF" alt="" /></p>
<p>Mostly I have made use of this trick in test situations where I want to simulate a set of external data to see how my MIIS code deals with it. Perhaps I need to test for certain odd situations that are a bit hard to generate in the real environment, so as a short-cut I construct an import.xml to feed the right data into MIIS.</p>
<p>You could also change a setting in an export.xml file to test how the change effects the external environment. Maybe you can&#8217;t get access to make the change directly and this way you can piggy-back on MIIS&#8217;s existing permissions, without actually having to modify extension code or flow rules.</p>
<p>And now here is where I confess that I&#8217;m writing this post tonight because I actually used this hack on a production system today &lt;gasp&gt;. Not sure why, but MIIS was giving me repeated dn-attributes-failure messages when I attempted to export a group. It was complaining a new member didn&#8217;t exist in AD - but it <em>did </em>(I got a collegue to double-check just in case I was going nuts!). After trying various full import/syncs I finally resorted to hacking the export.xml to change the &#8220;add&#8221; member command to a &#8220;delete&#8221;. The export then completed (making no changes as the user wasn&#8217;t in the group yet after all), I resync&#8217;d everything, the member add was duly re-queued, and this time it exported happily. I&#8217;m still trying to figure out why this situation happened in the first place, but as a sneaky fix-it, the log file hack got me back in business quicker than any of the alternative, and more drastic methods.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/hacking-the-importexport-logs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring MIIS</title>
		<link>http://www.wapshere.com/missmiis/monitoring-miis</link>
		<comments>http://www.wapshere.com/missmiis/monitoring-miis#comments</comments>
		<pubDate>Sun, 29 Jul 2007 02:37:15 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[MIIS 2003]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=70</guid>
		<description><![CDATA[Good monitoring and alerting is an essential, but often under-loved, part of any computing infrastructure. The complexities and multiple dependencies of even a straight-forward MIIS installation make systematic monitoring absolutely essential. Server Health Obviously you will be monitoring that the server itself is actually up. I believe something a little more than a ping is required [...]]]></description>
			<content:encoded><![CDATA[<p>Good monitoring and alerting is an essential, but often under-loved, part of any computing infrastructure. The complexities and multiple dependencies of even a straight-forward MIIS installation make systematic monitoring absolutely essential.</p>
<h4>Server Health</h4>
<p>Obviously you will be monitoring that the server itself is actually up. I believe something a little more than a ping is required to confirm the server is alive and well, so monitor key services such as MIIS and SQL Server. </p>
<p>Disk space monitoring is critical as a full partition will stop all MIIS activity. The SQL log drive (which you should have on completely seperate disks to your data, as per SQL best practises) can fill up alarmingly quickly and needs to be checked regularly. You should be alerted at 85-90% capacity on your Data drive, and 50% on your Log drive.</p>
<p>CPU and Memory are less critical as MIIS won&#8217;t stop, it will just run slower. You should, however, be collecting stats over the long term so you can assess the performance of the server.</p>
<h4>Application Events</h4>
<p>There&#8217;s some sort of <a target="_blank" href="http://msdn2.microsoft.com/en-us/library/ms696543.aspx">Logging class</a> in MIIS, but I actually never used it because I was happy with the messages in the Application Event Log. I just set a watch for particular events and that let me know when there were sync and export errors.</p>
<h4>Scheduled Tasks</h4>
<p>If you are running any kind of scheduled tasks around MIIS you must monitor them to make sure they are actually happening. An absolutely critical one is <a href="http://www.wapshere.com/missmiis/?p=22">the clear-down of the Run History</a>. I set a watch on the log file to verify that it runs successfully every night.</p>
<h4>SQL</h4>
<p>Regular SQL maintenance tasks should be monitored, as well as any replication jobs or scheduled DTS packages. I believe this can all be done with native SQL tools, though I can&#8217;t say for sure as I&#8217;ve always left it up to the DBA!</p>
<h4>Monitoring Software</h4>
<p>I used <a target="_blank" href="http://www.mercury.com/us/products/business-availability-center/sitescope/" title="Mercury Sitescope">Sitescope</a> very successfully to do all the monitoring listed above, with the exception of the SQL stuff (which, as I said, was the DBA&#8217;s domain). I cannot comment on the effectiveness of any other package, but if you&#8217;re evaluating, look for something that can monitor:</p>
<ul>
<li>services,</li>
<li>server physicals &#8211; memory, cpu, disk utilisation,</li>
<li>the server event log, and</li>
<li>log files.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/monitoring-miis/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Stylesheet for the Import and Export Logs</title>
		<link>http://www.wapshere.com/missmiis/a-stylesheet-for-the-import-and-export-logs</link>
		<comments>http://www.wapshere.com/missmiis/a-stylesheet-for-the-import-and-export-logs#comments</comments>
		<pubDate>Tue, 26 Jun 2007 03:25:21 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=35</guid>
		<description><![CDATA[Follwing on from yesterday&#8217;s post, where I wrote about hanging on to your import and export logs, I now present a way to view them using an xml stylesheet. The first problem with this approach is that the xml files produced by MIIS don’t work with a stylesheet. The stylesheet name must be included in [...]]]></description>
			<content:encoded><![CDATA[<p><span lang="EN-GB"><font face="Times New Roman">Follwing on from <a href="http://www.wapshere.com/missmiis/?p=31">yesterday&#8217;s post</a>, where I wrote about hanging on to your import and export logs, I now present a way to view them using an xml stylesheet.</font></span><span lang="EN-GB"><font face="Times New Roman"> </font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span lang="EN-GB"><font face="Times New Roman">The first problem with this approach is that the xml files produced by MIIS don’t work with a stylesheet. The stylesheet name must be included in the xml file, and I also found I needed to remove and change a few tags to get it working (probably just due to my inexperience – this is the first xml stylesheet I’ve written).</font></span><br />
 </p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span lang="EN-GB"><font face="Times New Roman">Yesterday I posted a script to be run directly after any Import or Export job, which copies the log file to a datestamped version. It is a straight-forward matter to improve this script so that, instead of a file copy, it modifies the datestamped log to allow it to work with my stylesheet.</font></span></p>
<p><span lang="EN-GB"><font face="Times New Roman">Follw this link for <a target="_blank" href="http://www.wapshere.com/missmiis/?page_id=32">the full ArchiveLog sub</a>.</font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span lang="EN-GB"><font face="Times New Roman">Next take a copy of this <a target="_blank" href="http://www.wapshere.com/missmiis/?page_id=33">log.xsl stylesheet</a> and put it in your Ma Data folder.</font></span></p>
<p><span lang="EN-GB"><font face="Times New Roman">The result should be that you can view the xml data in a browser in a nicely formatted way. At this point I had hoped to include a screenshot, but I’m having some trouble with my virtual server this morning, so you’ll just have to try it yourself!</font></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/a-stylesheet-for-the-import-and-export-logs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the Value from your Import and Export Logs</title>
		<link>http://www.wapshere.com/missmiis/getting-the-value-from-your-import-and-export-logs</link>
		<comments>http://www.wapshere.com/missmiis/getting-the-value-from-your-import-and-export-logs#comments</comments>
		<pubDate>Mon, 25 Jun 2007 08:17:36 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=31</guid>
		<description><![CDATA[As I’ve mentioned before, I don’t think there’s a lot of value in keeping days of Run History. Far more useful are the Import and Export logs that you should be dumping from your Run Profiles. Using these files you can track exactly what went in and out, and more importantly, when it happened. This [...]]]></description>
			<content:encoded><![CDATA[<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span lang="EN-GB"><font face="Times New Roman">As I’ve <a href="http://www.wapshere.com/missmiis/?p=22">mentioned before</a>, I don’t think there’s a lot of value in keeping days of Run History. Far more useful are the Import and Export logs that you should be dumping from your Run Profiles. Using these files you can track exactly what went in and out, and more importantly, when it happened. This can be an invaluable aid in <a href="http://www.wapshere.com/missmiis/?p=4">reducing fear and loathing of Identity Management</a> – either by showing that MIIS blamelessly passed bad data through, or by proving that the setting was changed in the <a href="http://www.wapshere.com/missmiis/?page_id=8#CDS">CDS</a>, and not by MIIS itself, in some <a href="http://www.amazon.com/Terminator-Judgment-Day-Ultimate-DVD/dp/B00004TRD8">Judgement Day</a> style malicious awakening.</font></span></p>
<p><span lang="EN-GB"><font face="Times New Roman">One thing I do wish MIIS could do is timestamp these log files. The native configuration will overwrite the last log file, and where’s the use in that? However using MASequencer, or something like my <a href="http://www.wapshere.com/missmiis/?p=26">simple queuing system</a>, you should be able to insert steps to rename the log files following each Import and Export operation.</font></span>  <span lang="EN-GB"><font face="Times New Roman">Now to start with, you’re going to have an easier time if you’re always consistent with your log file naming. I keep it simple – <strong>import.xml</strong> and <strong>export.xml</strong>. I then encorporate the following VBScript sub into my <a href="http://www.wapshere.com/missmiis/?p=26">scheduling script</a> to copy the log to a datestamped version.</font></span><span lang="EN-GB"></span></p>
<blockquote>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font face="Microsoft Sans Serif" size="1">Sub ArchiveLog(MA, Profile)</font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font face="Microsoft Sans Serif" size="1">‘ The Profile passed to the sub must be either “import” or “export”</font></span><span lang="EN-GB"></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>    </span>Dim objLogFile, objArchiveFile</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>    </span>Dim strLogName, strArchiveName, logTime, dateStamp, strLine</font></font></span><span lang="EN-GB"></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>    </span>strLogName = MIIS_FOLDER &amp; “MaData” &amp; MA &amp; “” &amp;_</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif">                                 Profile &amp; “.xml”</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>    </span>If objFS.FileExists(strLogName) Then</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>        </span>logTime = Now()</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>        </span>dateStamp = DatePart(“yyyy”, logTime) &amp; TwoChars(“m”, logTime) &amp;_</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>                                  </span>TwoChars(“d”, logTime) &amp; TwoChars(“h”, logTime) &amp;_</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>                                  </span>TwoChars(“n”, logTime) &amp; TwoChars(“s”, logTime)</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>        </span>strArchiveName = MIIS_FOLDER &amp; “MaData” &amp; MA &amp; “” &amp;_</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif">                                  Profile &amp; dateStamp &amp; “.xml”</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font face="Microsoft Sans Serif" size="1">        Set objFile = objFS.GetFile(strLogName)</font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font face="Microsoft Sans Serif" size="1">        objFile.Copy strArchiveName</font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>    </span>End If</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font face="Microsoft Sans Serif" size="1">End Sub</font></span></p>
<p><span lang="EN-GB"></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font face="Microsoft Sans Serif" size="1">Function TwoChars(dtvar, time)</font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>    </span>i = DatePart(dtvar, time)</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>    </span>If i &lt; 10 Then</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>        </span>TwoChars = “0” &amp; CStr(i)</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>    </span>Else</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>        </span>TwoChars = CStr(i)</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font size="1"><font face="Microsoft Sans Serif"><span>    </span>End If</font></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="Code"><span lang="EN-GB"><font face="Microsoft Sans Serif" size="1">End Function</font></span></p>
</blockquote>
<p>The XML files will need to be parsed somehow if you want to view them. I make a few simple modifications so that mine can be viewed in a browser using an XML stylesheet &#8211; more on that in <a href="http://www.wapshere.com/missmiis/?p=35">this post.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/getting-the-value-from-your-import-and-export-logs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keep That Run History Under Control!</title>
		<link>http://www.wapshere.com/missmiis/keep-that-run-history-under-control</link>
		<comments>http://www.wapshere.com/missmiis/keep-that-run-history-under-control#comments</comments>
		<pubDate>Tue, 19 Jun 2007 04:38:05 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[ILM 2007]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[MIIS 2003]]></category>
		<category><![CDATA[newbie]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=22</guid>
		<description><![CDATA[I expect that learning to keep the Run History under control is something that most MIIS designers have learnt through unpleasant experience. But in case you haven’t, a brief overview. The Run History is stored in the MicrosoftIdentityIntegrationServer database, and contributes massively to the growth the database. If you don’t regularly delete the Run History, [...]]]></description>
			<content:encoded><![CDATA[<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span lang="EN-GB"><font face="Times New Roman">I expect that learning to keep the Run History under control is something that most MIIS designers have learnt through unpleasant experience. But in case you haven’t, a brief overview.</font></span></p>
<p><span lang="EN-GB"><font face="Times New Roman">The Run History is stored in the MicrosoftIdentityIntegrationServer database, and contributes massively to the growth the database. If you don’t regularly delete the Run History, your DB files will grow and grow until the disk is full. When this happens you’re in big trouble &#8211; MIIS will no longer be able to do anything. Clearing the History also requires large amounts of free space on the volume holding the transaction log file. This file needs to be expanded in the clearing process – and the more you’re trying to clear, the more disk space will be needed. I have even heard a story about someone who had to install an extra disk on the MIIS server just to provide this expansion space!</font></span></p>
<p><span lang="EN-GB"><font face="Times New Roman">So now you know how important it is to keep on top of this, how much Run History should you keep? Personally I would say no more than two days. The data in it is actually not that useful – if you try and inspect an old Export, for example, MIIS will show you the object <em>as it appears now</em>, rather than how it looked at the time of the Export. A far better bet is to <a href="http://www.wapshere.com/missmiis/?p=31">generate export and import logs</a> as part of your Run Profiles, and keep those for as long as the business requires.</font></span></p>
<p><span lang="EN-GB"><font face="Times New Roman">The best way to clear Run History is by using MIISClearRunHistory from the </font><a href="http://go.microsoft.com/fwlink/?LinkId=22788"><font face="Times New Roman">MIIS Resource Toolkit</font></a><font face="Times New Roman">. This will allow you to create a little batch file which you can set to run overnight from the Windows Scheduler.</font></span></p>
<blockquote><p><span lang="EN-GB"><span class="StyleMicrosoftSansSerif9pt"><span style="font-size: 9pt" lang="EN-GB"><font face="Microsoft Sans Serif">miisclearrunhistory.exe /pr:2 /l:2</font></span></span><span lang="EN-GB"><font face="Times New Roman"> </font></span></span></p></blockquote>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span lang="EN-GB"><font face="Times New Roman">This command will create a log file, and my final tip is that you should monitor that file! Find out whatever monitoring system is available that can handle a log file (I’m most familiar with </font><a href="http://www.mercury.com/us/products/business-availability-center/sitescope/"><font face="Times New Roman">Sitescope</font></a><font face="Times New Roman">, but I expect there’s plenty of other options) and set a watch on that file! </font></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/keep-that-run-history-under-control/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
