<?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, 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>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>A Basic Requests Reporting Method</title>
		<link>http://www.wapshere.com/missmiis/a-basic-requests-reporting-method</link>
		<comments>http://www.wapshere.com/missmiis/a-basic-requests-reporting-method#comments</comments>
		<pubDate>Fri, 29 Apr 2011 14:47:01 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[FIM 2010]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[Reporting]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=1411</guid>
		<description><![CDATA[There were a few FIM reporting sessions at TEC, none of which I managed to make it to, though I hope the presenters will be making their solutions generally available as they are undoubtably more correct and complete than what I&#8217;ve been doing. However a couple of people did ask that I post my method [...]]]></description>
			<content:encoded><![CDATA[<p>There were a few FIM reporting sessions at TEC, none of which I managed to make it to, though I hope the presenters will be making their solutions generally available as they are undoubtably more correct and complete than what I&#8217;ve been doing. However a couple of people did ask that I post my method which is, in my usually simplistic DIY fashion, a rip of data direct from the FIMService DB using queries.</p>
<blockquote><p>Note: this workaround should become redundant with R2 which includes archiving of request data. Looking forward to that!</p></blockquote>
<p><span id="more-1411"></span></p>
<h3>Create Reporting Tables</h3>
<p>Start by creating the following tables in the database you use for reporting (ie NOT one of the DBs installed by FIM. I have a dedicated DB called &#8220;FIMReporting&#8221;):</p>
<pre>USE [FIMReporting]
CREATE TABLE [dbo].[fim_requests_new](
	[ObjectKey] [nvarchar](50) NULL,
	[Attribute] [nvarchar](50) NULL,
	[Value] [nvarchar](max) NULL
) ON [PRIMARY]</pre>
<p>&nbsp;</p>
<pre>USE [FIMReporting]
CREATE TABLE [dbo].[fim_requests_log](
	[ObjectKey] [nvarchar](150) NULL,
	[Creator] [nvarchar](150) NULL,
	[CreatedTime] [nvarchar](150) NULL,
	[CommittedTime] [nvarchar](150) NULL,
	[Operation] [nvarchar](150) NULL,
	[Target] [nvarchar](150) NULL,
	[TargetObjectType] [nvarchar](150) NULL,
	[ManagementPolicy] [nvarchar](500) NULL,
	[RequestStatus] [nvarchar](150) NULL,
	[RequestParameter] [nvarchar](max) NULL
) ON [PRIMARY]</pre>
<h3>Extract recent requests</h3>
<p>Once an hour, at the end of the regular sync cycle, I run this SQL script to copy out the requests I haven&#8217;t yet logged:</p>
<pre>truncate table FIMReporting.dbo.fim_requests_new;

insert into FIMReporting.dbo.fim_requests_new
select o.ObjectKey, 'ObjectKey' as Attribute, o.ObjectKey as Value
from FIMService.fim.Objects o
left outer join dbo.fim_requests_log l
on o.ObjectKey = l.ObjectKey
inner join FIMService.fim.ObjectValueString s
on o.ObjectKey = s.ObjectKey
where o.ObjectTypeKey = 26
and l.ObjectKey is null
and s.AttributeKey = 66;

insert into FIMReporting.dbo.fim_requests_new
select v.ObjectKey, a.Name as Attribute, CAST(v.ValueBoolean as nvarchar) as Value
from FIMService.fim.ObjectValueBoolean v
join FIMService.fim.AttributeInternal a
on v.AttributeKey = a.[Key]
join FIMReporting.dbo.fim_requests_new n
on v.ObjectKey = n.ObjectKey
where n.Attribute = 'ObjectKey';

insert into FIMReporting.dbo.fim_requests_new
select v.ObjectKey, a.Name as Attribute, CAST(v.ValueDateTime as nvarchar) as Value
from FIMService.fim.ObjectValueDateTime v
join FIMService.fim.AttributeInternal a
on v.AttributeKey = a.[Key]
join FIMReporting.dbo.fim_requests_new n
on v.ObjectKey = n.ObjectKey
where n.Attribute = 'ObjectKey';

insert into FIMReporting.dbo.fim_requests_new
select v.ObjectKey, a.Name as Attribute, CAST(ValueInteger as nvarchar) as Value
from FIMService.fim.ObjectValueInteger v
join FIMService.fim.AttributeInternal a
on v.AttributeKey = a.[Key]
join FIMReporting.dbo.fim_requests_new n
on v.ObjectKey = n.ObjectKey
where n.Attribute = 'ObjectKey';

insert into FIMReporting.dbo.fim_requests_new
select v.ObjectKey, a.Name as Attribute, name.ValueString as Value
from FIMService.fim.ObjectValueReference v
join FIMService.fim.AttributeInternal a
on v.AttributeKey = a.[Key]
join FIMReporting.dbo.fim_requests_new n
on v.ObjectKey = n.ObjectKey
join FIMService.fim.Objects ref
on v.ValueReference = ref.ObjectKey
join FIMService.fim.ObjectValueString name
on ref.ObjectKey = name.ObjectKey
where n.Attribute = 'ObjectKey'
and name.AttributeKey = 66;

insert into FIMReporting.dbo.fim_requests_new
select v.ObjectKey, Name as Attribute, ValueString as Value
from FIMService.fim.ObjectValueString v
join FIMService.fim.AttributeInternal a
on v.AttributeKey = a.[Key]
join FIMReporting.dbo.fim_requests_new n
on v.ObjectKey = n.ObjectKey
where n.Attribute = 'ObjectKey';

insert into FIMReporting.dbo.fim_requests_new
select v.ObjectKey, Name as Attribute, ValueText as Value
 from FIMService.fim.ObjectValueText v
join FIMService.fim.AttributeInternal a
on v.AttributeKey = a.[Key]
join FIMReporting.dbo.fim_requests_new n
on v.ObjectKey = n.ObjectKey
where n.Attribute = 'ObjectKey';</pre>
<h3>Pivot query</h3>
<p>I then have to run another SQL script to pivot the data so I end up with one line per request in my log table:</p>
<pre>use FIMReporting

insert into dbo.fim_requests_log

SELECT ObjectKey,Creator,CreatedTime,CommittedTime,Operation,[Target],
       TargetObjectType,ManagementPolicy,RequestStatus,RequestParameter
FROM
    (select * from dbo.fim_requests_new
	where ObjectKey in (
	select ObjectKey from dbo.fim_requests_new
	where Attribute = 'RequestStatus'
	and Value in ('Completed','Failed','Denied','PostProcessingError') )) as src
PIVOT
( MAX(Value) FOR Attribute
    IN ( Creator,CreatedTime,CommittedTime,Operation,[Target],TargetObjectType,ManagementPolicy,RequestStatus,RequestParameter)
) AS pvt;</pre>
<h3>Pruning</h3>
<p>As I don&#8217;t want the data in this log to build up and up I have a third script which I run once a day to prune records. I do this in two steps &#8211; first I get rid of requests made by the service accounts, and later I delete all requests.</p>
<pre>use FIMReporting

declare @pruneDays as int
declare @deleteDays as int
set @pruneDays = 50 /* Must be greater than number of day kept in FIMService DB */
set @deleteDays = 180

declare @today as nvarchar(50)
set @today = GetDate()

delete from dbo.fim_requests_log
where datediff(day,CONVERT(datetime,CreatedTime),@today) &gt; @deleteDays

/* Prune service account requests. YOUR ACCOUNT NAMES WILL VARY. */
delete from dbo.fim_requests_log
where datediff(day,CONVERT(datetime,CreatedTime),@today) &gt; @pruneDays
and Creator in ('s-fimportal', 'Forefront Identity Manager Service Account', 'Built-in Synchronization Account')</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/a-basic-requests-reporting-method/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating RequestStatusDetail</title>
		<link>http://www.wapshere.com/missmiis/updating-requeststatusdetail</link>
		<comments>http://www.wapshere.com/missmiis/updating-requeststatusdetail#comments</comments>
		<pubDate>Sat, 19 Feb 2011 08:00:17 +0000</pubDate>
		<dc:creator>Carol</dc:creator>
				<category><![CDATA[FIM 2010]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://www.wapshere.com/missmiis/?p=1301</guid>
		<description><![CDATA[Not long ago I wrote a post about writing status messages back to the Request object from a custom workflow. I used custom attributes because I was following the only documentation I could find. But Henrik said &#8220;why don&#8217;t you use RequestStatusDetail?&#8221; &#8211; and actually the reasons were a. I hadn&#8217;t thought of it, and [...]]]></description>
			<content:encoded><![CDATA[<p>Not long ago I wrote a post about <a href="http://www.wapshere.com/missmiis/passing-data-from-a-custom-workflow-via-the-request-object">writing status messages back to the Request</a> object from a custom workflow. I used custom attributes because I was following <a href="http://msdn.microsoft.com/en-us/library/ff463694.aspx">the only documentation I could find</a>. But <a href="http://idmcrisis.com/">Henrik</a> said &#8220;why don&#8217;t you use RequestStatusDetail?&#8221; &#8211; and actually the reasons were a. I hadn&#8217;t thought of it, and b. I didn&#8217;t know how.</p>
<p>But now I&#8217;ve had a play with it, and figured out how to update the field (it needs to be in XML) and why it&#8217;s very cool to do so (it makes the message easily available to the user).<br />
<span id="more-1301"></span><br />
In my custom workflow I have the following activities:</p>
<ul>
<li>A CurrentRequestActivity</li>
<li>A code activity, and</li>
<li>A ResourceUpdateActivity.</li>
</ul>
<p>During my code activity I have set two variables:</p>
<ul>
<li>Boolean &#8220;success&#8221;, and</li>
<li>String &#8220;returnMessage&#8221;.</li>
</ul>
<p>Now at the end of my code activity I add the following code to prepare the ground for the ResourceUpdateActivity (which I&#8217;ve named &#8220;updateRequestDetails&#8221;) that writes the message back.</p>
<pre>        Me.updateRequestDetails_ActorId1 = New Guid(FIMADMIN_GUID)
        Me.updateRequestDetails_ResourceId1 = Me.currentRequestActivity.CurrentRequest.ObjectID
        Dim returnXML As String
        Dim returnLevel As String
        If success Then
            returnLevel = "Information"
        Else
            returnLevel = "Error"
        End If
        returnXML = "&lt;RequestStatusDetail xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" " _
                    &amp; "xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" DetailLevel=""" &amp; returnLevel &amp; """ " _
                    &amp; "EntryTime=""" &amp; DateTime.Now.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'") &amp; """&gt;" _
                    &amp; returnMessage &amp; "&lt;/RequestStatusDetail&gt;"
        Dim updateInstruction As New UpdateRequestParameter
        updateInstruction.PropertyName = "RequestStatusDetail"
        updateInstruction.Mode = UpdateMode.Insert
        updateInstruction.Value = returnXML
        Me.updateRequestDetails_UpdateParameters1 = New UpdateRequestParameter() {updateInstruction}</pre>
<p>I&#8217;ve used the FIM Admin account to write the message, and I had to explicitly give it permission to write to the RequestStatusDetail attribute of the Request resource type. You could also use the requestor&#8217;s account to update the field (Me.updateRequestDetails_ActorId1 = Me.currentRequestActivity.CurrentRequest.Creator), but you will still need to explicitly grant permissions with an MPR (have a look at the &#8220;Request Management: Request creators can&#8230;&#8221; MPRs to see what you need to do).</p>
<p>And here&#8217;s a picture of the Request after the custom workflow activity failed.</p>
<p><a href="http://www.wapshere.com/missmiis/wp-content/uploads/2011/02/requeststatusdetail.jpg"><img class="alignnone size-full wp-image-1305" title="requeststatusdetail" src="http://www.wapshere.com/missmiis/wp-content/uploads/2011/02/requeststatusdetail.jpg" alt="" width="544" height="361" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wapshere.com/missmiis/updating-requeststatusdetail/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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 Service, just [...]]]></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 <a href="http://www.wapshere.com/missmiis/code-snippets/logxsl">this content</a>.</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></p>
<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 &amp; "\MaData\" &amp; MA &amp; "\" &amp; LogFile
  If objFS.FileExists(strLogName) Then
    logTime = Now()
    dateStamp = DatePart("yyyy", logTime) &amp; TwoChars("m", logTime) &amp;_
                                 TwoChars("d", logTime) &amp; TwoChars("h", logTime) &amp;_
                                 TwoChars("n", logTime) &amp; TwoChars("s", logTime)
    strArchiveName = ARCHIVE_FOLDER &amp; "\" &amp; MA &amp; "\" &amp; Split(LogFile,".")(0) &amp; "_" &amp; dateStamp &amp; ".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=""" &amp; XML_STYLESHEET &amp; """?&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" &amp; 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> </p>
<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></p>
<pre>cscript AD_Export.vbs
cscript ArchiveLog.vbs "AD MA" export.xml</pre>
<p> </p>
<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>4</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 actually [...]]]></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 to confirm [...]]]></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, your [...]]]></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>

