<?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>Servus</title>
	<atom:link href="http://servusinc.org/myblog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://servusinc.org/myblog</link>
	<description>Hello and Goodbye</description>
	<lastBuildDate>Fri, 27 Aug 2010 08:03:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Windows 2008 R2 Server Backup Feature to Backup Exchange 2010</title>
		<link>http://servusinc.org/myblog/?p=778</link>
		<comments>http://servusinc.org/myblog/?p=778#comments</comments>
		<pubDate>Fri, 27 Aug 2010 08:03:14 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://servusinc.org/myblog/?p=778</guid>
		<description><![CDATA[
 
http://blogs.techrepublic.com.com/datacenter/?p=3006
	
]]></description>
			<content:encoded><![CDATA[<p>
 </p>
<p><a href="http://blogs.techrepublic.com.com/datacenter/?p=3006">http://blogs.techrepublic.com.com/datacenter/?p=3006</a>
	</p>
]]></content:encoded>
			<wfw:commentRss>http://servusinc.org/myblog/?feed=rss2&amp;p=778</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Active Directory – Object Metadata</title>
		<link>http://servusinc.org/myblog/?p=771</link>
		<comments>http://servusinc.org/myblog/?p=771#comments</comments>
		<pubDate>Tue, 13 Jul 2010 22:03:16 +0000</pubDate>
		<dc:creator>Olga</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://servusinc.org/myblog/?p=771</guid>
		<description><![CDATA[View the metadata for an AD object to find out more details about when its specific attributes were modified.  This is very handy when trying to troubleshoot details about a specific object..  See when and where an attribute was updated which can also help track down who made the change if the entry [...]]]></description>
			<content:encoded><![CDATA[<p>View the metadata for an AD object to find out more details about when its specific attributes were modified.  This is very handy when trying to troubleshoot details about a specific object..  See when and where an attribute was updated which can also help track down who made the change if the entry was captured in the domain controller event logs.. <span id="more-771"></span></p>
<p>Here&#8217;s the syntax and an example of what data you will get back..</p>
<p>Repadmin /showobjmeta DCNAME &#8220;full object DN&#8221;</p>
<p>C:\&gt;repadmin /showobjmeta DC01 &#8220;cn=SVCAccount,ou=accounts,dc=domain,dc=corp&#8221;</p>
<p>58 entries.</p>
<p>Loc.USN                              Originating DC   Org.USN  Org.Time/Date        Ver Attribute</p>
<p>=======                             =============== ===============        === =========</p>
<p>16740030                            DFW1\DC01  16740030 2009-10-28 11:18:43    1 objectClass</p>
<p>16740030                            DFW1\DC01  16740030 2009-10-28 11:18:43    1 cn</p>
<p>29079766                            DFW1\DC01  29079766 2010-03-23 16:23:35    3 sn</p>
<p>29079766                            DFW1\DC01  29079766 2010-03-23 16:23:35    2 title</p>
<p>16740030                            DFW1\DC01  16740030 2009-10-28 11:18:43    1 description</p>
<p>39541488                            DFW1\DC01  39541488 2010-07-12 12:03:56 39 givenName</p>
<p>16740030                            DFW1\DC01  16740030 2009-10-28 11:18:43    1 whenCreated</p>
<p>29079766                            DFW1\DC01  29079766 2010-03-23 16:23:35    6 displayName</p>
<p>29079766                            DFW1\DC01  29079766 2010-03-23 16:23:35    3 co</p>
<p>16741438                            DFW1\DC01  16741438 2009-10-28 11:42:45    2 department</p>
<p>16740030                            DFW1\DC01  16740030 2009-10-28 11:18:43    1 name</p>
<p>39259708                            SAN1\DC02  32310052 2010-07-09 10:52:46    4 userAccountControl</p>
<p>38694997                              SAN2\DC03  93941776 2010-07-03 17:56:41    1 homeDirectory</p>
<p>38694997                              SAN2\DC03  93941776 2010-07-03 17:56:41    1 homeDrive</p>
<p>28995344                            SAN1\DC02  23187706 2010-03-22 15:48:22    4 ntPwdHistory</p>
<p>28995344                            SAN1\DC02  23187706 2010-03-22 15:48:22    4 pwdLastSet</p>
<p>16740031                            DFW1\DC01  16740031 2009-10-28 11:18:43    1 primaryGroupID</p>
<p>…………</p>
<p>Most of these details are self explanatory.. Ver is the number of modifications to a particular attribute..</p>
<p>Now you have when and where a specific attribute was modified and can track down who did it by looking in the security log <span style="font-family: Wingdings;">J</span></p>
<p><em> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://servusinc.org/myblog/?feed=rss2&amp;p=771</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Missing Group Memberships in AD??</title>
		<link>http://servusinc.org/myblog/?p=768</link>
		<comments>http://servusinc.org/myblog/?p=768#comments</comments>
		<pubDate>Tue, 29 Jun 2010 15:01:45 +0000</pubDate>
		<dc:creator>Olga</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://servusinc.org/myblog/?p=768</guid>
		<description><![CDATA[I ran into something really interesting today that took some time to figure out.. Thought I should post in case anyone else is puzzled by the same scenario (and so that I can remember later).
I was running queries for group memberships and found inconsistencies between what I was seeing in ADUC and what my queries [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into something really interesting today that took some time to figure out.. Thought I should post in case anyone else is puzzled by the same scenario (and so that I can remember later).</p>
<p>I was running queries for group memberships and found inconsistencies between what I was seeing in ADUC and what my queries were pulling back.  In ADUC, I could see user accounts in a group that did not show up in the query results or when I looked in ADSIEDIT.</p>
<p><span id="more-768"></span></p>
<p>I checked permissions, looked at the different attributes of the accounts, compared ldp outputs.  I finally noticed that the primary group memberships were changed to the groups that I was querying and not &#8216;domain users&#8217; which is the default.  With the primary group designation, the account is not listed in the member attribute for the group nor is the group listed in the memberof attribute for the account.</p>
<p>There really aren&#8217;t any compelling reasons to update an account primary group designation, unless you want the account to have more restrictive rights than a regular domain user, like guest users.  Otherwise, it is a bit confusing and requires applications to look at more than just the memberof or member attributes on users and groups to determine access.</p>
]]></content:encoded>
			<wfw:commentRss>http://servusinc.org/myblog/?feed=rss2&amp;p=768</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exchange 2010</title>
		<link>http://servusinc.org/myblog/?p=766</link>
		<comments>http://servusinc.org/myblog/?p=766#comments</comments>
		<pubDate>Fri, 04 Jun 2010 03:32:23 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://servusinc.org/myblog/?p=766</guid>
		<description><![CDATA[http://www.windowsitpro.com/article/outlook-web-access-owa/owa-vs-outlook-in-2010.aspx
http://www.windowsitpro.com/blogs/exchangeandoutlook/tabid/780/entryid/12813/Exchange-Server-2010-Adoption-Excitement.aspx
]]></description>
			<content:encoded><![CDATA[<p>http://www.windowsitpro.com/article/outlook-web-access-owa/owa-vs-outlook-in-2010.aspx</p>
<p>http://www.windowsitpro.com/blogs/exchangeandoutlook/tabid/780/entryid/12813/Exchange-Server-2010-Adoption-Excitement.aspx</p>
]]></content:encoded>
			<wfw:commentRss>http://servusinc.org/myblog/?feed=rss2&amp;p=766</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic IIS log housekeeping</title>
		<link>http://servusinc.org/myblog/?p=763</link>
		<comments>http://servusinc.org/myblog/?p=763#comments</comments>
		<pubDate>Thu, 03 Jun 2010 21:19:23 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://servusinc.org/myblog/?p=763</guid>
		<description><![CDATA[There is not much automation taking place in my current company.  I&#8217;m working to automate as many processes as possible, and therefore increase our productivity.  The article below was borrowed from the following link. http://www.808.dk/?code-iis-log-housekeeping


A collection of scripts that can keep the IIS server&#8217;s HTTP/SMTP/FTP logs from filling up drives.
Depending on the script chosen, you [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Verdana; font-size: 13pt;"><span style="color: #000000;">There is not much automation taking place in my current company.  I&#8217;m working to automate as many processes as possible, and therefore increase our productivity.  The article below was borrowed from the following link. </span></span><span style="color: black; font-family: Verdana; font-size: 12pt;"><a href="http://www.808.dk/?code-iis-log-housekeeping">http://www.808.dk/?code-iis-log-housekeeping</a></span></p>
<p><span style="color: black; font-family: Verdana; font-size: 12pt;"><span id="more-763"></span><br />
</span></p>
<p style="background: #ecece6;"><span style="color: black; font-family: Verdana; font-size: 10pt;">A collection of scripts that can keep the IIS server&#8217;s HTTP/SMTP/FTP logs from filling up drives.</span></p>
<p>Depending on the script chosen, you can have different archiving (compression) and file retention times, or just simple delete-older-than log rotation. The log locations can be automatically retrieved from the IIS metabase (additional configuration needed for IIS 7.x), or specified manually.</p>
<ul>
<li>
<div style="background: #ecece6;"><a href="http://www.808.dk/?code-iis-log-housekeeping"><span style="color: #1a5bb5; font-family: Verdana; font-size: 10pt;">Script for specifying log locations manually, logs are archived and deleted</span></a><span style="color: black; font-family: Verdana; font-size: 10pt;"><br />
</span></div>
</li>
<li>
<div style="background: #ecece6;"><a href="http://www.808.dk/?code-iis-log-housekeeping"><span style="color: #1a5bb5; font-family: Verdana; font-size: 10pt;">Script for specifying log locations manually, logs are just deleted</span></a><span style="color: black; font-family: Verdana; font-size: 10pt;"><br />
</span></div>
</li>
<li>
<div style="background: #ecece6;"><a href="http://www.808.dk/?code-iis-log-housekeeping"><span style="color: #1a5bb5; font-family: Verdana; font-size: 10pt;">Script that finds log locations automatically, logs are archived and deleted</span></a><span style="color: black; font-family: Verdana; font-size: 10pt;"><br />
</span></div>
</li>
<li>
<div style="background: #ecece6;"><a href="http://www.808.dk/?code-iis-log-housekeeping"><span style="color: #1a5bb5; font-family: Verdana; font-size: 10pt;">Script that finds log locations automatically, logs are just deleted</span></a><span style="color: black; font-family: Verdana; font-size: 10pt;"><br />
</span></div>
</li>
</ul>
<p style="background: #ecece6;"><span style="color: black; font-family: Verdana; font-size: 10pt;">Save the code as a .vbs file and run it daily as a scheduled job on the server.</span></p>
<p>Note that the scripts using compression need the command line version of the free 7-Zip compressor available on <a href="http://www.7-zip.org/download.html"><span style="color: #1a5bb5;">http://www.7-zip.org/download.html</span></a></p>
<p><strong>Housekeeping script, manual log locations, logs are archived and deleted:</strong><a name="ManualPlusArchive"></a></p>
<p style="background: #ddddd7; margin-left: 11pt;"><span style="color: black; font-family: Courier New; font-size: 8pt;">Option Explicit<br />
WScript.Timeout = 82800</span></p>
<p>&#8216; This Script archives (compresses to a zip file, then deletes the<br />
&#8216; original) IIS log files older than a specified number of days.<br />
&#8216; The script can also delete the compressed archive files older<br />
&#8216; than another specified number of days.<br />
&#8216;<br />
&#8216; Run it as a daily scheduled task on high traffic web servers to<br />
&#8216; avoid running out of disc space. IIS logs can typically be<br />
&#8216; compressed to well below 1/20 of the original file size.<br />
&#8216;<br />
&#8216; The script needs the command line version of the free 7-Zip<br />
&#8216; compressor available on http://www.7-zip.org/<br />
&#8216;<br />
&#8216; The ArchiveLogFiles function takes three parameters:<br />
&#8216; &#8220;Path to log dir&#8221;<br />
&#8216; &#8220;Compress log files older than n days and delete the original files&#8221;<br />
&#8216; &#8220;Delete compressed log files older than n days&#8221;<br />
&#8216;<br />
&#8216; Multiple function calls can be added to archive files in different<br />
&#8216; log folders with different log retentions.<br />
&#8216;<br />
&#8216; Note that the function runs through subfolders recursively, so if<br />
&#8216; the same log retention should be used on a whole log folder tree<br />
&#8216; structure, only one call with the root log folder is needed.<br />
&#8216; Additional calls with specific subfolders can then be made to have<br />
&#8216; shorter retentions on those.<br />
&#8216;<br />
&#8216; Edit the example lines below to match the log folder paths,<br />
&#8216; archive and retention values needed on the server.</p>
<p>ArchiveLogFiles &#8220;D:\Logfiles&#8221;, 30, 180<br />
ArchiveLogFiles &#8220;D:\Logfiles\W3SVC1&#8243;, 14, 30<br />
ArchiveLogFiles &#8220;D:\Logfiles\W3SVC243&#8243;, 5, 30<br />
ArchiveLogFiles &#8220;D:\Logfiles\SMTPSVC1&#8243;, 7, 60</p>
<p>Function ArchiveLogFiles(strLogPath, intZipAge, intDelAge)<br />
  Dim objFs<br />
  Dim objFsCheck<br />
  Dim objFolder<br />
  Dim objSubFolder<br />
  Dim objFile<br />
  Dim objWShell<br />
  Set objWShell = CreateObject(&#8220;WScript.Shell&#8221;)<br />
  Set objFs = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />
  Set objFsCheck = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />
  If Right(strLogPath, 1) &lt;&gt; &#8220;\&#8221; Then<br />
    strLogPath = strLogPath &amp; &#8220;\&#8221;<br />
  End If<br />
  If objFs.FolderExists(strLogPath) Then<br />
    Set objFolder = objFs.GetFolder(strLogPath)<br />
      For Each objSubFolder in objFolder.subFolders<br />
        ArchiveLogFiles strLogPath &amp; objSubFolder.Name, intZipAge, intDelAge<br />
      Next<br />
      For Each objFile in objFolder.Files<br />
        If (InStr(objFile.Name, &#8220;ex&#8221;) &gt; 0) _<br />
          And (Right(objFile.Name, 4) = &#8220;.log&#8221;) Then<br />
          If DateDiff(&#8220;d&#8221;,objFile.DateLastModified,Date) &gt; intZipAge Then<br />
            objWShell.Run &#8220;7za.exe a -tzip &#8220;&#8221;" &amp; strLogPath &amp; _<br />
              Left(objFile.Name,Len(objFile.Name)-3) &amp; &#8220;zip&#8221;" &#8220;&#8221;" &amp; _<br />
              strLogPath &amp; objFile.Name &amp; &#8220;&#8221;"&#8221;, 7, true<br />
            If objFsCheck.FileExists(strLogPath &amp; _<br />
              Left(objFile.Name,Len(objFile.Name)-3) &amp; &#8220;zip&#8221;) And _<br />
              (objFsCheck.FileExists(strLogPath &amp; objFile.Name)) Then<br />
                objFsCheck.DeleteFile(strLogPath &amp; objFile.Name)<br />
            End If<br />
          End If<br />
        ElseIf (InStr(objFile.Name, &#8220;ex&#8221;) &gt; 0) _<br />
          And (Right(objFile.Name, 4) = &#8220;.zip&#8221;) Then<br />
          If DateDiff(&#8220;d&#8221;,objFile.DateLastModified,Date) &gt; intDelAge Then<br />
            objFsCheck.DeleteFile(strLogPath &amp; objFile.Name)<br />
          End If<br />
        End If<br />
      Next<br />
    Set objFs = Nothing<br />
    Set objFsCheck = Nothing<br />
    Set objFolder = Nothing<br />
    Set objWShell = nothing<br />
  End If<br />
End Function</p>
<p style="background: #ecece6;"><span style="color: black; font-family: Verdana; font-size: 10pt;"><br />
<strong>Housekeeping script, manual log locations, logs are just deleted:</strong><a name="ManualJustDelete"></a><br />
</span></p>
<p style="background: #ddddd7; margin-left: 11pt;"><span style="color: black; font-family: Courier New; font-size: 8pt;">Option Explicit<br />
WScript.Timeout = 82800</span></p>
<p>&#8216; This Script deletes IIS log files older than a specified number<br />
&#8216; of days.<br />
&#8216;<br />
&#8216; Run it as a daily scheduled task on high traffic web servers to<br />
&#8216; avoid running out of disc space.<br />
&#8216;<br />
&#8216; The DeleteLogFiles function takes two parameters:<br />
&#8216; &#8220;Path to log dir&#8221;<br />
&#8216; &#8220;Delete log files older than n days&#8221;<br />
&#8216;<br />
&#8216; Multiple function calls can be added to delete files in different<br />
&#8216; log folders with different log retentions.<br />
&#8216;<br />
&#8216; Note that the function runs through subfolders recursively, so if<br />
&#8216; the same log retention should be used on a whole log folder tree<br />
&#8216; structure, only one call with the root log folder is needed.<br />
&#8216; Additional calls with specific subfolders can then be made to have<br />
&#8216; shorter retentions on those.<br />
&#8216;<br />
&#8216; Edit the example lines below to match the log folder paths and<br />
&#8216; retention values needed on the server.</p>
<p>DeleteLogFiles &#8220;D:\Logfiles&#8221;, 30<br />
DeleteLogFiles &#8220;D:\Logfiles\W3SVC1&#8243;, 14<br />
DeleteLogFiles &#8220;D:\Logfiles\W3SVC243&#8243;, 5<br />
DeleteLogFiles &#8220;D:\Logfiles\SMTPSVC1&#8243;, 7</p>
<p>Function DeleteLogFiles(strLogPath, intDelAge)<br />
  Dim objFs<br />
  Dim objFolder<br />
  Dim objSubFolder<br />
  Dim objFile<br />
  Dim objWShell<br />
  Set objWShell = CreateObject(&#8220;WScript.Shell&#8221;)<br />
  Set objFs = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />
  If Right(strLogPath, 1) &lt;&gt; &#8220;\&#8221; Then<br />
    strLogPath = strLogPath &amp; &#8220;\&#8221;<br />
  End If<br />
  If objFs.FolderExists(strLogPath) Then<br />
    Set objFolder = objFs.GetFolder(strLogPath)<br />
      For Each objSubFolder in objFolder.subFolders<br />
        DeleteLogFiles strLogPath &amp; objSubFolder.Name, intDelAge<br />
      Next<br />
      For Each objFile in objFolder.Files<br />
        If (InStr(objFile.Name, &#8220;ex&#8221;) &gt; 0) _<br />
          And (Right(objFile.Name, 4) = &#8220;.log&#8221;) Then<br />
          If DateDiff(&#8220;d&#8221;,objFile.DateLastModified,Date) &gt; intDelAge Then<br />
            objFs.DeleteFile(strLogPath &amp; objFile.Name)<br />
          End If<br />
        End If<br />
      Next<br />
    Set objFs = Nothing<br />
    Set objFolder = Nothing<br />
    Set objWShell = nothing<br />
  End If<br />
End Function</p>
<p style="background: #ecece6;"><span style="color: black; font-family: Verdana; font-size: 10pt;"><br />
<strong>Housekeeping script, automatic log locations, logs are archived and deleted:</strong><a name="AutomaticPlusArchive"></a><br />
</span></p>
<p style="background: #ddddd7; margin-left: 11pt;"><span style="color: black; font-family: Courier New; font-size: 8pt;">Option Explicit<br />
WScript.Timeout = 82800</span></p>
<p>&#8216; This Script archives (compresses to a zip file, then deletes the<br />
&#8216; original) IIS log files older than a specified number of days.<br />
&#8216; The script can also delete the compressed archive files older<br />
&#8216; than another specified number of days.<br />
&#8216;<br />
&#8216; Run it as a daily scheduled task on high traffic web servers to<br />
&#8216; avoid running out of disc space. IIS logs can typically be<br />
&#8216; compressed to well below 1/20 of the original file size.<br />
&#8216;<br />
&#8216; The script needs the command line version of the free 7-Zip<br />
&#8216; compressor available on http://www.7-zip.org/<br />
&#8216;<br />
&#8216; Edit the values for intZipAge and intDelAge to set the archive and<br />
&#8216; retention times needed on the server.<br />
&#8216;<br />
&#8216; The locations of the IIS log files are found automatically (for this<br />
&#8216; to also work on IIS 7.x on Windows Vista, Windows Server 2008 or<br />
&#8216; Windows 7, please enable &#8220;IIS 6 Metabase Compatibility&#8221; aka<br />
&#8216; &#8220;IIS Metabase and IIS 6 configuration compatibility&#8221;).</p>
<p>Dim intZipAge<br />
Dim intDelAge<br />
intZipAge = 30<br />
intDelAge = 180<br />
Dim objIIS<br />
Dim objWeb<br />
Dim objIISOuter<br />
Dim objWebOuter</p>
<p>Set objIISOuter = GetObject(&#8220;IIS://LOCALHOST&#8221;)<br />
For Each objWebOuter in objIISOuter<br />
  If LCase(objWebOuter.Class) = &#8220;iiswebservice&#8221; Then<br />
    Set objIIS = GetObject(&#8220;IIS://LOCALHOST/W3SVC&#8221;)<br />
    For Each objWeb in objIIS<br />
      If LCase(objWeb.Class) = &#8220;iiswebserver&#8221; Then<br />
        Call ArchiveLogFiles( _<br />
          objWeb.LogFileDirectory &amp; &#8220;\W3SVC&#8221; &amp; objWeb.Name, _<br />
          intZipAge, _<br />
          intDelAge)<br />
      End If<br />
    Next<br />
  ElseIf LCase(objWebOuter.Class) = &#8220;iissmtpservice&#8221; Then<br />
    Set objIIS = GetObject(&#8220;IIS://LOCALHOST/SMTPSVC&#8221;)<br />
    For Each objWeb in objIIS<br />
      If LCase(objWeb.Class) = &#8220;iissmtpserver&#8221; Then<br />
        Call ArchiveLogFiles( _<br />
          objWeb.LogFileDirectory &amp; &#8220;\SMTPSVC&#8221; &amp; objWeb.Name, _<br />
          intZipAge, _<br />
          intDelAge)<br />
      End If<br />
    Next<br />
  ElseIf LCase(objWebOuter.Class) = &#8220;iisftpservice&#8221; Then<br />
    Set objIIS = GetObject(&#8220;IIS://LOCALHOST/MSFTPSVC&#8221;)<br />
    For Each objWeb in objIIS<br />
      If LCase(objWeb.Class) = &#8220;iisftpserver&#8221; Then<br />
        Call ArchiveLogFiles( _<br />
          objWeb.LogFileDirectory &amp; &#8220;\MSFTPSVC&#8221; &amp; objWeb.Name, _<br />
          intZipAge, _<br />
          intDelAge)<br />
      End If<br />
    Next<br />
  End If<br />
Next</p>
<p>Set objIIS = nothing<br />
Set objIISOuter = nothing</p>
<p>Function ArchiveLogFiles(strLogPath, intZipAge, intDelAge)<br />
  Dim objFs<br />
  Dim objFsCheck<br />
  Dim objFolder<br />
  Dim objSubFolder<br />
  Dim objFile<br />
  Dim objWShell<br />
  Set objWShell = CreateObject(&#8220;WScript.Shell&#8221;)<br />
  Set objFs = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />
  Set objFsCheck = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />
  If Right(strLogPath, 1) &lt;&gt; &#8220;\&#8221; Then<br />
    strLogPath = strLogPath &amp; &#8220;\&#8221;<br />
  End If<br />
  If objFs.FolderExists(strLogPath) Then<br />
    Set objFolder = objFs.GetFolder(strLogPath)<br />
      For Each objSubFolder in objFolder.subFolders<br />
        ArchiveLogFiles strLogPath &amp; objSubFolder.Name, intZipAge, intDelAge<br />
      Next<br />
      For Each objFile in objFolder.Files<br />
        If (InStr(objFile.Name, &#8220;ex&#8221;) &gt; 0) _<br />
          And (Right(objFile.Name, 4) = &#8220;.log&#8221;) Then<br />
          If DateDiff(&#8220;d&#8221;,objFile.DateLastModified,Date) &gt; intZipAge Then<br />
            objWShell.Run &#8220;7za.exe a -tzip &#8220;&#8221;" &amp; strLogPath &amp; _<br />
              Left(objFile.Name,Len(objFile.Name)-3) &amp; &#8220;zip&#8221;" &#8220;&#8221;" &amp; _<br />
              strLogPath &amp; objFile.Name &amp; &#8220;&#8221;"&#8221;, 7, true<br />
            If objFsCheck.FileExists(strLogPath &amp; _<br />
              Left(objFile.Name,Len(objFile.Name)-3) &amp; &#8220;zip&#8221;) And _<br />
              (objFsCheck.FileExists(strLogPath &amp; objFile.Name)) Then<br />
                objFsCheck.DeleteFile(strLogPath &amp; objFile.Name)<br />
            End If<br />
          End If<br />
        ElseIf (InStr(objFile.Name, &#8220;ex&#8221;) &gt; 0) _<br />
          And (Right(objFile.Name, 4) = &#8220;.zip&#8221;) Then<br />
          If DateDiff(&#8220;d&#8221;,objFile.DateLastModified,Date) &gt; intDelAge Then<br />
            objFsCheck.DeleteFile(strLogPath &amp; objFile.Name)<br />
          End If<br />
        End If<br />
      Next<br />
    Set objFs = Nothing<br />
    Set objFsCheck = Nothing<br />
    Set objFolder = Nothing<br />
    Set objWShell = nothing<br />
  End If<br />
End Function</p>
<p style="background: #ecece6;"><span style="color: black; font-family: Verdana; font-size: 10pt;"><br />
<strong>Housekeeping script, automatic log locations, logs are just deleted:</strong><a name="AutomaticJustDelete"></a><br />
</span></p>
<p style="background: #ddddd7; margin-left: 11pt;"><span style="color: black; font-family: Courier New; font-size: 8pt;">Option Explicit<br />
WScript.Timeout = 82800</span></p>
<p>&#8216; This Script deletes IIS log files older than a specified number<br />
&#8216; of days.<br />
&#8216;<br />
&#8216; Run it as a daily scheduled task on high traffic web servers to<br />
&#8216; avoid running out of disc space.<br />
&#8216;<br />
&#8216; Edit the value for intDelAge to set retention times needed on<br />
&#8216; the server.<br />
&#8216;<br />
&#8216; The locations of the IIS log files are found automatically (for this<br />
&#8216; to also work on IIS 7.x on Windows Vista, Windows Server 2008 or<br />
&#8216; Windows 7, please enable &#8220;IIS 6 Metabase Compatibility&#8221; aka<br />
&#8216; &#8220;IIS Metabase and IIS 6 configuration compatibility&#8221;).</p>
<p>Dim intDelAge<br />
intDelAge = 30<br />
Dim objIIS<br />
Dim objWeb<br />
Dim objIISOuter<br />
Dim objWebOuter<br />
Set objIISOuter = GetObject(&#8220;IIS://LOCALHOST&#8221;)<br />
For Each objWebOuter in objIISOuter<br />
  If LCase(objWebOuter.Class) = &#8220;iiswebservice&#8221; Then<br />
    Set objIIS = GetObject(&#8220;IIS://LOCALHOST/W3SVC&#8221;)<br />
    For Each objWeb in objIIS<br />
      If LCase(objWeb.Class) = &#8220;iiswebserver&#8221; Then<br />
        Call DeleteLogFiles( _<br />
          objWeb.LogFileDirectory &amp; &#8220;\W3SVC&#8221; &amp; objWeb.Name, _<br />
          intDelAge)<br />
      End If<br />
    Next<br />
  ElseIf LCase(objWebOuter.Class) = &#8220;iissmtpservice&#8221; Then<br />
    Set objIIS = GetObject(&#8220;IIS://LOCALHOST/SMTPSVC&#8221;)<br />
    For Each objWeb in objIIS<br />
      If LCase(objWeb.Class) = &#8220;iissmtpserver&#8221; Then<br />
        Call DeleteLogFiles( _<br />
          objWeb.LogFileDirectory &amp; &#8220;\SMTPSVC&#8221; &amp; objWeb.Name, _<br />
          intDelAge)<br />
      End If<br />
    Next<br />
  ElseIf LCase(objWebOuter.Class) = &#8220;iisftpservice&#8221; Then<br />
    Set objIIS = GetObject(&#8220;IIS://LOCALHOST/MSFTPSVC&#8221;)<br />
    For Each objWeb in objIIS<br />
      If LCase(objWeb.Class) = &#8220;iisftpserver&#8221; Then<br />
        Call DeleteLogFiles( _<br />
          objWeb.LogFileDirectory &amp; &#8220;\MSFTPSVC&#8221; &amp; objWeb.Name, _<br />
          intDelAge)<br />
      End If<br />
    Next<br />
  End If<br />
Next</p>
<p>Set objIIS = nothing<br />
Set objIISOuter = nothing</p>
<p>Function DeleteLogFiles(strLogPath, intDelAge)<br />
  Dim objFs<br />
  Dim objFolder<br />
  Dim objSubFolder<br />
  Dim objFile<br />
  Dim objWShell<br />
  Set objWShell = CreateObject(&#8220;WScript.Shell&#8221;)<br />
  Set objFs = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />
  If Right(strLogPath, 1) &lt;&gt; &#8220;\&#8221; Then<br />
    strLogPath = strLogPath &amp; &#8220;\&#8221;<br />
  End If<br />
  If objFs.FolderExists(strLogPath) Then<br />
    Set objFolder = objFs.GetFolder(strLogPath)<br />
      For Each objSubFolder in objFolder.subFolders<br />
        DeleteLogFiles strLogPath &amp; objSubFolder.Name, intDelAge<br />
      Next<br />
      For Each objFile in objFolder.Files<br />
        If (InStr(objFile.Name, &#8220;ex&#8221;) &gt; 0) _<br />
          And (Right(objFile.Name, 4) = &#8220;.log&#8221;) Then<br />
          If DateDiff(&#8220;d&#8221;,objFile.DateLastModified,Date) &gt; intDelAge Then<br />
            objFs.DeleteFile(strLogPath &amp; objFile.Name)<br />
          End If<br />
        End If<br />
      Next<br />
    Set objFs = Nothing<br />
    Set objFolder = Nothing<br />
    Set objWShell = nothing<br />
  End If<br />
End Function</p>
]]></content:encoded>
			<wfw:commentRss>http://servusinc.org/myblog/?feed=rss2&amp;p=763</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A good PowerShell resource.</title>
		<link>http://servusinc.org/myblog/?p=761</link>
		<comments>http://servusinc.org/myblog/?p=761#comments</comments>
		<pubDate>Wed, 05 May 2010 19:39:33 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Exchange Server]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://servusinc.org/myblog/?p=761</guid>
		<description><![CDATA[ 
http://powershellcommunity.org/Forums.aspx
]]></description>
			<content:encoded><![CDATA[<p> </p>
<p><a href="http://powershellcommunity.org/Forums.aspx">http://powershellcommunity.org/Forums.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://servusinc.org/myblog/?feed=rss2&amp;p=761</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exchangepedia &#8211; Exchange Shell Quick Reference</title>
		<link>http://servusinc.org/myblog/?p=759</link>
		<comments>http://servusinc.org/myblog/?p=759#comments</comments>
		<pubDate>Fri, 16 Apr 2010 22:32:02 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://servusinc.org/myblog/?p=759</guid>
		<description><![CDATA[ 
https://exchangepedia.com/blog/stuff/ExQuick.htm
]]></description>
			<content:encoded><![CDATA[<p> </p>
<p><a href="https://exchangepedia.com/blog/stuff/ExQuick.htm">https://exchangepedia.com/blog/stuff/ExQuick.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://servusinc.org/myblog/?feed=rss2&amp;p=759</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote Shutdown Syntax</title>
		<link>http://servusinc.org/myblog/?p=757</link>
		<comments>http://servusinc.org/myblog/?p=757#comments</comments>
		<pubDate>Thu, 11 Mar 2010 18:09:15 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://servusinc.org/myblog/?p=757</guid>
		<description><![CDATA[I don&#8217;t use this command often enough to remember the syntax, so here it is:
shutdown /r /m \\servername /t 000
]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t use this command often enough to remember the syntax, so here it is:</p>
<p>shutdown /r /m <a href="file://\\sat4mx09">\\servername</a> /t 000</p>
]]></content:encoded>
			<wfw:commentRss>http://servusinc.org/myblog/?feed=rss2&amp;p=757</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find out when your Password Expires</title>
		<link>http://servusinc.org/myblog/?p=752</link>
		<comments>http://servusinc.org/myblog/?p=752#comments</comments>
		<pubDate>Thu, 11 Mar 2010 16:31:52 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://servusinc.org/myblog/?p=752</guid>
		<description><![CDATA[Few weeks ago I came across this question &#8220;How to find out an account&#8217;s password expiration date&#8221; in one of our internal mailing-list. This looks like a simple question, but when we tried to find the answer we realized it is not a trivial task. One of my colleagues pointed to this 22-printed page detailed [...]]]></description>
			<content:encoded><![CDATA[<p>Few weeks ago I came across this question &#8220;How to find out an account&#8217;s password expiration date&#8221; in one of our internal mailing-list. This looks like a simple question, but when we tried to find the answer we realized it is not a trivial task. One of my colleagues pointed to <a href="http://msdn.microsoft.com/en-us/library/ms974598.aspx"><span style="color: blue; text-decoration: underline;">this</span></a> 22-printed page detailed MSDN article that describes how to find a user account&#8217;s password expiration date. The steps described in this article are a bit outdated. It does not take <a href="http://www.bing.com/search?q=AD+DS+fine+grained+password+policy"><span style="color: blue; text-decoration: underline;">Fine-Grained Password policy</span></a> (a new feature added in Windows 2008) into account while calculating the maximum password age. With the addition of fine grained password policy, this becomes an even more daunting task to do. Using AD Powershell this task can be achieved with ~40 lines of script-code. Here is function that calculates the password expiration date of a user object given its samAccountName, security identifier or DistinguishedName.  <span id="more-752"></span></p>
<p><span style="font-family: Courier New; font-size: 8pt;">1: function Get-XADUserPasswordExpirationDate() {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">2:    Param ([Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, HelpMessage="Identity of the Account")]<br />
</span><span style="font-family: Courier New; font-size: 8pt;">3:    [Object] $accountIdentity)<br />
</span><span style="font-family: Courier New; font-size: 8pt;">4:    PROCESS {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">5:       $accountObj = Get-ADUser $accountIdentity -properties PasswordExpired, PasswordNeverExpires, PasswordLastSet<br />
</span><span style="font-family: Courier New; font-size: 8pt;">6:       if ($accountObj.PasswordExpired) {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">7:          echo (&#8220;Password of account: &#8221; + $accountObj.Name + &#8221; already expired!&#8221;)<br />
</span><span style="font-family: Courier New; font-size: 8pt;">8:       } else {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">9:          if ($accountObj.PasswordNeverExpires) {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">10:            echo (&#8220;Password of account: &#8221; + $accountObj.Name + &#8221; is set to never expires!&#8221;)<br />
</span><span style="font-family: Courier New; font-size: 8pt;">11:         } else {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">12:            $passwordSetDate = $accountObj.PasswordLastSet<br />
</span><span style="font-family: Courier New; font-size: 8pt;">13:            if ($passwordSetDate -eq $null) {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">14:               echo (&#8220;Password of account: &#8221; + $accountObj.Name + &#8221; has never been set!&#8221;)<br />
</span><span style="font-family: Courier New; font-size: 8pt;">15:            } else {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">16:               $maxPasswordAgeTimeSpan = $null<br />
</span><span style="font-family: Courier New; font-size: 8pt;">17:               $dfl = (get-addomain).DomainMode<br />
</span><span style="font-family: Courier New; font-size: 8pt;">18:             if ($dfl -ge 3) {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">19:                ## Greater than Windows2008 domain functional level<br />
</span><span style="font-family: Courier New; font-size: 8pt;">20:                $accountFGPP = Get-ADUserResultantPasswordPolicy $accountObj<br />
</span><span style="font-family: Courier New; font-size: 8pt;">21:                if ($accountFGPP -ne $null) {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">22:                   $maxPasswordAgeTimeSpan = $accountFGPP.MaxPasswordAge<br />
</span><span style="font-family: Courier New; font-size: 8pt;">23:                } else {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">24:                   $maxPasswordAgeTimeSpan = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge<br />
</span><span style="font-family: Courier New; font-size: 8pt;">25:                }<br />
</span><span style="font-family: Courier New; font-size: 8pt;">26:             } else {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">27:                $maxPasswordAgeTimeSpan = (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge<br />
</span><span style="font-family: Courier New; font-size: 8pt;">28:             }<br />
</span><span style="font-family: Courier New; font-size: 8pt;">29:             if ($maxPasswordAgeTimeSpan -eq $null -or $maxPasswordAgeTimeSpan.TotalMilliseconds -eq 0) {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">30:                echo (&#8220;MaxPasswordAge is not set for the domain or is set to zero!&#8221;)<br />
</span><span style="font-family: Courier New; font-size: 8pt;">31:             } else {<br />
</span><span style="font-family: Courier New; font-size: 8pt;">32:                echo (&#8220;Password of account: &#8221; + $accountObj.Name + &#8221; expires on: &#8221; + ($passwordSetDate + $maxPasswordAgeTimeSpan))<br />
</span><span style="font-family: Courier New; font-size: 8pt;">33:             }<br />
</span><span style="font-family: Courier New; font-size: 8pt;">34:          }<br />
</span><span style="font-family: Courier New; font-size: 8pt;">35:       }<br />
</span><span style="font-family: Courier New; font-size: 8pt;">36:     }<br />
</span><span style="font-family: Courier New; font-size: 8pt;">37:   }<br />
</span><span style="font-family: Courier New; font-size: 8pt;">38: }<br />
</span></p>
<p> <br />
 </p>
<p>Here are some sample usages of this function:</p>
<p style="background: white; margin-left: 36pt;"><span style="color: black; font-size: 10pt;"><strong>PS AD:\&gt; Get-XADUserPasswordExpirationDate testuser1<br />
</strong></span></p>
<p style="background: white; margin-left: 36pt;"><span style="color: black; font-size: 10pt;"><strong>Password of account: testuser1 already expired!<br />
</strong></span></p>
<p style="background: white; margin-left: 36pt;"> </p>
<p style="background: white; margin-left: 36pt;"><span style="color: black; font-size: 10pt;"><strong>PS AD:\&gt; Get-XADUserPasswordExpirationDate JohnDoe<br />
</strong></span></p>
<p style="background: white; margin-left: 36pt;"><span style="color: black; font-size: 10pt;"><strong>Password of account: John Doe expires on: 02/25/2010 13:03:20<br />
</strong></span></p>
<p>Since the MSDN article explains the algorithm using a flow diagram, I too have tried creating a flow diagram that explains the logic used to compute the password expiration date of an account:</p>
<p><a href="http://blogs.msdn.com/blogfiles/adpowershell/WindowsLiveWriter/FindoutwhenyourPasswordExpires_D5D8/clip_image002_2.png"><img src="http://servusinc.org/myblog/wp-content/uploads/2010/03/031110_1631_Findoutwhen11.png" border="0" alt="" /></a><span style="font-size: 12pt;"><br />
</span></p>
<p> <br />
 </p>
<p>Hope you find this useful. Please leave a comment if you have any feedback on this topic or would like to see any other topic discussed in our blog.</p>
<p> <br />
 </p>
<p>Enjoy,</p>
<p>Swami</p>
]]></content:encoded>
			<wfw:commentRss>http://servusinc.org/myblog/?feed=rss2&amp;p=752</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reporting on ActiveSync</title>
		<link>http://servusinc.org/myblog/?p=747</link>
		<comments>http://servusinc.org/myblog/?p=747#comments</comments>
		<pubDate>Fri, 26 Feb 2010 15:52:18 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Exchange Server]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://servusinc.org/myblog/?p=747</guid>
		<description><![CDATA[Exchange logs quite a bit of info about ActiveSync device partnerships and you can use this to create reports about the utilization of mobility features in your organization. Getting this data requires a couple of intermediate steps before you can export it to a CSV for processing in something like Excel (or another script). The [...]]]></description>
			<content:encoded><![CDATA[<p>Exchange logs quite a bit of info about ActiveSync device partnerships and you can use this to create reports about the utilization of mobility features in your organization. Getting this data requires a couple of intermediate steps before you can export it to a CSV for processing in something like Excel (or another script). The PowerShell script below will export all of the ActiveSync device relationships in your organization. Keep in mind that this will include old relationships which are no longer active. Depending on how large your organization is and the number of device relationships out there, it may take a little while for the script to run. <span id="more-747"></span></p>
<p><strong>Note: </strong>If you have a mixed version organization (e.g. Exchange 2007 and Exchange 2010), you&#8217;ll need to run the script twice. Once in the Exchange 2007 Management Shell and once in the Exchange 2010 Management Shell. The cmdlets used here are not backwards (or forward compatible). I&#8217;ve provided two versions of the script &#8211; one for Exchange 2007 and one for Exchange 2010.</p>
<p><strong>Exchange 2007 Version</strong></p>
<p style="margin-left: 36pt;">$devices = @()</p>
<p style="margin-left: 36pt;">$mailboxes = Get-CASMailbox -ResultSize:Unlimited | Where-Object {$_.HasActiveSyncDevicePartnership -eq $true -and $_.ExchangeVersion.ExchangeBuild -ilike &#8220;8*&#8221;}</p>
<p style="margin-left: 36pt;">foreach ($m in $mailboxes)</p>
<p style="margin-left: 36pt;">{</p>
<p style="margin-left: 36pt;">$devices += Get-ActiveSyncDeviceStatistics -Mailbox $m.Identity</p>
<p style="margin-left: 36pt;">}</p>
<p style="margin-left: 36pt;">$devices | Export-Csv DeviceStats.csv</p>
<p> </p>
<p><strong>Exchange 2010 Version</strong></p>
<p style="margin-left: 36pt;">$devices = @()</p>
<p style="margin-left: 36pt;">$mailboxes = Get-CASMailbox -ResultSize:Unlimited | Where-Object {$_.HasActiveSyncDevicePartnership -eq $true -and $_.ExchangeVersion.ExchangeBuild -ilike &#8220;14*&#8221;}</p>
<p style="margin-left: 36pt;">foreach ($m in $mailboxes)</p>
<p style="margin-left: 36pt;">{</p>
<p style="margin-left: 36pt;">$devices += Get-ActiveSyncDeviceStatistics -Mailbox $m.Identity</p>
<p style="margin-left: 36pt;">}</p>
<p style="margin-left: 36pt;">$devices | Export-Csv DeviceStats.csv</p>
<p>You can open the exported CSV in Excel from here and generate reports based on that. There is quite a bit of information in the report including some personally identifiable information (PII) for the devices so keep that in mind before redistributing the raw data file.</p>
<p>This was written by <a href="http://briandesmond.com/blog/how-to-create-an-activesync-device-report/">Brian Desmond</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://servusinc.org/myblog/?feed=rss2&amp;p=747</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
