{"id":31,"date":"2007-06-25T08:17:36","date_gmt":"2007-06-25T08:17:36","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?p=31"},"modified":"2023-01-16T06:12:27","modified_gmt":"2023-01-16T06:12:27","slug":"getting-the-value-from-your-import-and-export-logs","status":"publish","type":"post","link":"https:\/\/www.wapshere.com\/missmiis\/getting-the-value-from-your-import-and-export-logs","title":{"rendered":"Getting the Value from your Import and Export Logs"},"content":{"rendered":"<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">As I&#8217;ve <a href=\"https:\/\/www.wapshere.com\/missmiis\/?p=22\">mentioned before<\/a>, I don&#8217;t think there&#8217;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=\"https:\/\/www.wapshere.com\/missmiis\/?p=4\">reducing fear and loathing of Identity Management<\/a> &#8211; either by showing that MIIS blamelessly passed bad data through, or by proving that the setting was changed in the <a href=\"https:\/\/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.<\/span><\/span><\/p>\n<p><span lang=\"EN-GB\"><span style=\"font-family: 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&#8217;s the use in that? However using MASequencer, or something like my <a href=\"https:\/\/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.<\/span><\/span> <span lang=\"EN-GB\"><span style=\"font-family: Times New Roman;\">Now to start with, you&#8217;re going to have an easier time if you&#8217;re always consistent with your log file naming. I keep it simple &#8211; <strong>import.xml<\/strong> and <strong>export.xml<\/strong>. I then encorporate the following VBScript sub into my <a href=\"https:\/\/www.wapshere.com\/missmiis\/?p=26\">scheduling script<\/a> to copy the log to a datestamped version.<\/span><\/span><\/p>\n<blockquote>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-family: Microsoft Sans Serif; font-size: xx-small;\">Sub ArchiveLog(MA, Profile)<\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-family: Microsoft Sans Serif; font-size: xx-small;\">\u00e2\u20ac\u02dc The Profile passed to the sub must be either \u00e2\u20ac\u0153import\u00e2\u20ac\u009d or \u00e2\u20ac\u0153export\u00e2\u20ac\u009d<\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> Dim objLogFile, objArchiveFile<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> Dim strLogName, strArchiveName, logTime, dateStamp, strLine<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> strLogName = MIIS_FOLDER &amp; \u00e2\u20ac\u0153MaData\u00e2\u20ac\u009d &amp; MA &amp; \u00e2\u20ac\u0153\u00e2\u20ac\u009d &amp;_<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> Profile &amp; \u00e2\u20ac\u0153.xml\u00e2\u20ac\u009d<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> If objFS.FileExists(strLogName) Then<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> logTime = Now()<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> dateStamp = DatePart(\u00e2\u20ac\u0153yyyy\u00e2\u20ac\u009d, logTime) &amp; TwoChars(\u00e2\u20ac\u0153m\u00e2\u20ac\u009d, logTime) &amp;_<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> TwoChars(\u00e2\u20ac\u0153d\u00e2\u20ac\u009d, logTime) &amp; TwoChars(\u00e2\u20ac\u0153h\u00e2\u20ac\u009d, logTime) &amp;_<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> TwoChars(\u00e2\u20ac\u0153n\u00e2\u20ac\u009d, logTime) &amp; TwoChars(\u00e2\u20ac\u0153s\u00e2\u20ac\u009d, logTime)<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> strArchiveName = MIIS_FOLDER &amp; \u00e2\u20ac\u0153MaData\u00e2\u20ac\u009d &amp; MA &amp; \u00e2\u20ac\u0153\u00e2\u20ac\u009d &amp;_<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> Profile &amp; dateStamp &amp; \u00e2\u20ac\u0153.xml\u00e2\u20ac\u009d<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-family: Microsoft Sans Serif; font-size: xx-small;\"> Set objFile = objFS.GetFile(strLogName)<\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-family: Microsoft Sans Serif; font-size: xx-small;\"> objFile.Copy strArchiveName<\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> End If<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-family: Microsoft Sans Serif; font-size: xx-small;\">End Sub<\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-family: Microsoft Sans Serif; font-size: xx-small;\">Function TwoChars(dtvar, time)<\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> i = DatePart(dtvar, time)<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> If i &lt; 10 Then<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> TwoChars = \u00e2\u20ac\u01530\u00e2\u20ac\u009d &amp; CStr(i)<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> Else<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> TwoChars = CStr(i)<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-size: xx-small;\"><span style=\"font-family: Microsoft Sans Serif;\"> End If<\/span><\/span><\/span><\/p>\n<p class=\"Code\" style=\"margin: 0cm 0cm 0pt;\"><span lang=\"EN-GB\"><span style=\"font-family: Microsoft Sans Serif; font-size: xx-small;\">End Function<\/span><\/span><\/p>\n<\/blockquote>\n<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=\"https:\/\/www.wapshere.com\/missmiis\/?p=35\">this post.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I&#8217;ve mentioned before, I don&#8217;t think there&#8217;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&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[34,9,28,10],"tags":[],"class_list":["post-31","post","type-post","status-publish","format-standard","hentry","category-ilm2007","category-logs","category-miis2003","category-vbscript"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pkp1o-v","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/31","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":3,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":3341,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/31\/revisions\/3341"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}