<?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>SysAdmin Talk &#187; Windows PowerShell</title>
	<atom:link href="http://sysadmin-talk.org/category/windows-powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://sysadmin-talk.org</link>
	<description>Practical advice from front-line SysAdmins</description>
	<lastBuildDate>Fri, 05 Aug 2011 16:59:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Video: How to Import PST files into Exchange 2010 &#8211; Part 3 of 3</title>
		<link>http://sysadmin-talk.org/2010/10/video-how-to-import-pst-files-into-exchange-2010-part-3-of-3/</link>
		<comments>http://sysadmin-talk.org/2010/10/video-how-to-import-pst-files-into-exchange-2010-part-3-of-3/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 15:24:02 +0000</pubDate>
		<dc:creator>James Allison</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Shell]]></category>
		<category><![CDATA[PST Files]]></category>
		<category><![CDATA[PST Importing]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows PowerShell]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=716</guid>
		<description><![CDATA[In this final video in James' 3-part series, we see how to use the Exchange Management Shell to import PST files into their appropriate mailboxes in Exchange 2010.]]></description>
			<content:encoded><![CDATA[<p>This is the third and final clip in this series explaining how to use the Exchange Management Shell to import PST files into Exchange 2010 mailboxes. In this video, now that we have a list of relevant machine names, as well as the names, owners and locations of PST files <em>on</em> those machines, we&#8217;ll run through a script to set up the Mailbox-Import requests from these PST files into their relevant mailboxes in Exchange. Further information can be found in this <a title="ding PST Files on the Network – The Manual Way" href="http://sysadmin-talk.org/2010/08/finding-pst-files-on-the-network-the-manual-way/">article</a>.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/8EIPLVKt3ok?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/8EIPLVKt3ok?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>In <a title="Part 1" href="http://sysadmin-talk.org/video-how-to-import-pst-files-into-exchange-2010-part-1-of-3/" target="_blank">part one of this series</a>, we looked at how to identify the relevant machines on your network (i.e. machines which are currently offering refuge to PST files), and <a title="Part 2" href="http://sysadmin-talk.org/video-how-to-import-pst-files-into-exchange-2010-%e2%80%93-part-2-of-3/" target="_blank">in part 2</a> we covered how to use the Exchange Management Shell to identify the filenames, owners and locations of the PST files those machines. This final video will complete the process, and cover the actual import procedure.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/10/video-how-to-import-pst-files-into-exchange-2010-part-3-of-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Video: How to Import PST Files into Exchange 2010 – Part 2 of 3</title>
		<link>http://sysadmin-talk.org/2010/10/video-how-to-import-pst-files-into-exchange-2010-%e2%80%93-part-2-of-3/</link>
		<comments>http://sysadmin-talk.org/2010/10/video-how-to-import-pst-files-into-exchange-2010-%e2%80%93-part-2-of-3/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 12:28:42 +0000</pubDate>
		<dc:creator>James Allison</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Shell]]></category>
		<category><![CDATA[PST Files]]></category>
		<category><![CDATA[PST Importing]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows PowerShell]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=705</guid>
		<description><![CDATA[The second video in a series of 3 videos explaining how to use the Exchange Management Shell to import PST files into Exchange 2010 mailboxes. In this video we will take the list of machine names we created in the previous video and use WMI to search each of these for PST files. We will [...]]]></description>
			<content:encoded><![CDATA[<p>The second video in a series of 3 videos explaining how to use the Exchange Management Shell to import PST files into Exchange 2010 mailboxes. In this video we will take the list of machine names we created in the previous video and use WMI to search each of these for PST files. We will then record the location of these files and the file owners. Further information can be found in this <a title="ding PST Files on the Network – The Manual Way" href="http://sysadmin-talk.org/2010/08/finding-pst-files-on-the-network-the-manual-way/">article</a>.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Peejf6kEAFc?fs=1&amp;hl=en_GB" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/Peejf6kEAFc?fs=1&amp;hl=en_GB" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
<p>In the previous <a title="Video: How to Import PST Files into Exchange 2010 – Part 2 of 3" href="video-how-to-import-pst-files-into-exchange-2010-part-2-of-3">video</a> I identified the machine names of the computers on my network for use in a subsequent search for PST files. In the next video I will look at the scripts that will setup the Import-Mailbox requests from these PSTs into the relevant mailboxes in Exchange.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/10/video-how-to-import-pst-files-into-exchange-2010-%e2%80%93-part-2-of-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video: How to Import PST Files into Exchange 2010 &#8211; Part 1 of 3</title>
		<link>http://sysadmin-talk.org/2010/10/video-how-to-import-pst-files-into-exchange-2010-part-1-of-3/</link>
		<comments>http://sysadmin-talk.org/2010/10/video-how-to-import-pst-files-into-exchange-2010-part-1-of-3/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 13:57:51 +0000</pubDate>
		<dc:creator>James Allison</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Shell]]></category>
		<category><![CDATA[IT Professional]]></category>
		<category><![CDATA[PST Files]]></category>
		<category><![CDATA[PST Importer]]></category>
		<category><![CDATA[PST Importing]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=681</guid>
		<description><![CDATA[I previously wrote a series of 3 articles explaining how to use the Exchange Management Shell to import PST files into Exchange 2010 mailboxes. To support these I am now creating a series of 3 videos. In this, the first video I look at identifying the machine names of the computers on your network for [...]]]></description>
			<content:encoded><![CDATA[<p>I previously wrote a series of <a href="http://sysadmin-talk.org/2010/08/how-to-import-pst-files-into-exchange-2010-the-manual-way/">3 articles</a> explaining how to use the Exchange Management Shell to import PST files into Exchange 2010 mailboxes. To support these I am now creating a series of 3 videos. In this, the first video I look at identifying the machine names of the computers on your network for use in a subsequent search for PST files.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/P3_bv0gaSrk?fs=1&amp;hl=en_GB" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/P3_bv0gaSrk?fs=1&amp;hl=en_GB" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
<p>In the next <a title="Video: How to Import PST Files into Exchange 2010 – Part 2 of 3" href="video-how-to-import-pst-files-into-exchange-2010-part-2-of-3">video</a> I will go through finding PST files on your network.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/10/video-how-to-import-pst-files-into-exchange-2010-part-1-of-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Address List Segregation or the “Hoster Edition” of Exchange Server 2010 SP1 – don’t even think about it!</title>
		<link>http://sysadmin-talk.org/2010/09/address-list-segregation-or-hoster-edition-exchange-2010-sp1/</link>
		<comments>http://sysadmin-talk.org/2010/09/address-list-segregation-or-hoster-edition-exchange-2010-sp1/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 13:50:49 +0000</pubDate>
		<dc:creator>Jaap Wesselius</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Shell]]></category>
		<category><![CDATA[IT Professional]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Windows PowerShell]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=612</guid>
		<description><![CDATA[All users in your Exchange organization are automatically listed in the Global Address List. When you have multiple departments, or maybe multiple companies (sometime also referred to as organizations, but this has nothing to do with the Exchange organization) in your Exchange organization you may want to organize or split up the Address List. When [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sysadmin-talk.org/wp-content/uploads/2010/09/EMC_HostedError.jpg" rel="lightbox[612]"></a>All users in your Exchange organization are automatically listed in the Global Address List. When you have multiple departments, or maybe multiple companies (sometime also referred to as organizations, but this has nothing to do with the Exchange organization) in your Exchange organization you may want to organize or split up the Address List. <span id="more-612"></span>When you do this appropriately each department or company will have its own Address List, and each Address List is only visible for users belonging to this particular company. Users will never notice other companies are hosted on the same Exchange Organization.</p>
<p>In Exchange Server 2007 this is not too difficult to accomplish. Microsoft has released a whitepaper on how to configure virtual organizations (i.e. companies) in Exchange Server 2007. This whitepaper can be found on the Technet Website: <a href="http://technet.microsoft.com/en-us/library/bb936719(EXCHG.80).aspx">http://technet.microsoft.com/en-us/library/bb936719(EXCHG.80).aspx</a> &#8211; Configuring Virtual Organizations and Address List Segregation in Exchange 2007.</p>
<p>It is tempting to try this in Exchange Server 2010 as well, but you would be best off avoiding doing so. There are a couple of issues (that Microsoft is working on) that will block a successful rollout of Address List Segregation. Besides that, it is not supported and it will also break Exchange Server 2010. More information regarding this can be found on Dave Goldman’s weblog: <a href="http://blogs.msdn.com/b/dgoldman/archive/2010/05/10/critical-update-exchange-2010-address-list-segregation-and-current-support-stances.aspx">http://blogs.msdn.com/b/dgoldman/archive/2010/05/10/critical-update-exchange-2010-address-list-segregation-and-current-support-stances.aspx</a> &#8211; CRITICAL UPDATE &#8211; Exchange 2010 Address List Segregation and Current Support Stances</p>
<p>You may be aware that in Exchange Server 2010 SP1 there’s a /hosting switch, making Exchange Server 2010 SP1 “multi tenant”. This means you can create multiple virtual organizations in Exchange Server 2010 SP1, completely invisible for each other. There’s already quite some information on the Internet regarding installation of Exchange Server 2010 SP1 with the /hosting switch, but most of this information is not coming directly from Microsoft!</p>
<p>This “<strong>hoster edition</strong>” of Exchange Server 2010 SP1 is targeted towards <strong>hosting companies</strong>, companies that currently have HMC (Hosted Messaging and Collaboration) 4.5 running. This is basically the Hosted Version of Exchange Server 2007, including Hosted Sharepoint and Hosted OCS. This implementation of Exchange Server 2010 is absolutely not targeted towards enterprise customers!</p>
<p>There are a number of issues you have to be aware of when you want to deploy the “hoster edition” of Exchange Server 2010 SP1:</p>
<ul>
<li><strong>You need an SPLA</strong> (Service Provider License Agreement) to use this version of Exchange Server 2010 SP1;</li>
<li>The Forest Functional level is Windows Server 2008;</li>
</ul>
<p>There is:</p>
<ul>
<li>No upgrade path (only a green field scneario);</li>
<li>No support for Unified Messaging;</li>
<li>No support for Edge and EdgeSync;</li>
<li>No support for multiple forests;</li>
<li>No support for multiple domains;</li>
<li>No Exchange Management Console;</li>
<li>No Public Folders;</li>
<li>No Federation;</li>
<li>No B2B features such as cross-premises message tracking and calender sharing;</li>
<li>No IRM;</li>
<li>No Outlook 2003 support (EnableLegacyOutlook);</li>
<li>No Support for OCS 2007 R2, only from 3rd party;</li>
<li>No Support for CRM;</li>
</ul>
<p>When you try to start the Exchange Management Console you’ll see that it is not supported:<a href="http://sysadmin-talk.org/wp-content/uploads/2010/09/EMC_HostedError.jpg" rel="lightbox[612]"><img class="alignleft size-full wp-image-614" title="Exchange Management Console Hosted" src="http://sysadmin-talk.org/wp-content/uploads/2010/09/EMC_HostedError.jpg" alt="Exchange Management Console isn't supported in a hosted environment" width="606" height="413" /></a></p>
<p>So, all configuration has to be done using the Exchange Management Shell. There’s some additional self service support on the Exchange Control Panel, but basically you’ll need to implement another 3<sup>rd</sup> party Control Panel for configuring the Exchange organization. Or create your own Control Panel. Please bare in mind that hosting companies often have dedicated developers that are working on these scenarios.</p>
<h2>Conclusion</h2>
<p>If you want to implement Address List Segregation on Exchange Server 2010 you cannot use the 2007 version of the Address List Segregation whitepaper. It will break Exchange Server 2010. Although very tempting to use, the Hoster Edition of Exchange Server 2010 SP1 is not an alternative for the enterprise customers. Don’t try it, don’t even think about it, there’s too much complexity for the average enterprise customer. Besides the Service Provider licensing, there’s too much functionality that’s not supported by Microsoft directly, or it is supported by a 3<sup>rd</sup> party. The best option is to wait and see if and when Microsoft releases the 2010 version of the Address List Segregation.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/09/address-list-segregation-or-hoster-edition-exchange-2010-sp1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Importing the Remote PSTs into Exchange 2010</title>
		<link>http://sysadmin-talk.org/2010/09/importing-psts-into-exchange-2010/</link>
		<comments>http://sysadmin-talk.org/2010/09/importing-psts-into-exchange-2010/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 15:45:33 +0000</pubDate>
		<dc:creator>James Allison</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[IT Professional]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[PST Files]]></category>
		<category><![CDATA[PST Importer]]></category>
		<category><![CDATA[PST Importing]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[messages]]></category>
		<category><![CDATA[PST]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=547</guid>
		<description><![CDATA[In the previous part of this guide we looked at gaining a list of PST files and machines. In this, the final part of this series, we will look at how to import these into Exchange 2010. The following script does just that: # Read in pst file locations and users $strPSTFiles = Get-Content -Path "c:\pstdetails.csv" [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a title="Finding PST Files on the Network" href="http://sysadmin-talk.org/2010/08/finding-pst-files-on-the-network-the-manual-way/" target="_self">previous part of this guide </a>we looked at gaining a list of PST files and machines. In this, the final part of this series, we will look at how to import these into Exchange 2010.<span id="more-547"></span></p>
<p>The following script does just that:</p>
<p><code># Read in pst file locations and users<br />
$strPSTFiles = Get-Content -Path "c:\pstdetails.csv"<br />
foreach($strPSTFile in $strPSTFiles)<br />
{</code><br />
<code>$strMachine = $strPSTFile.Split(',')[0]<br />
$strPath = $strPSTFile.Split(',')[1]<br />
$strOwner = $strPSTFile.Split(',')[2]</code></p>
<p><code># Get network path for pst file<br />
$source = "\\" + $strMachine + "\" + $strPath.Replace(':','$')</code></p>
<p><code># import pst to mail box.<br />
<span style="background-color: #ffff66;">Import-Mailbox -PSTFolderPath $source -Identity $strOwner</span><br />
<span style="background-color: #ff6666;">New-MailboxImportRequest -FilePath $source -Mailbox $strOwner</span><br />
}</code></p>
<p>The yellow highlighted text shows the Exchange 2010 RTM cmdlet, the red the Exchange 2010 SP1. Delete the unneeded version as appropriate.</p>
<p>The Exchange 2010 SP1 version of the script will execute in far less time, due to the asynchronous nature of the ImportRequest cmdlet. These requests are processed in the background and can be monitored with the Get-MailboxImportRequest cmdlet to observe their status.</p>
<p>There are quite a few potential pitfalls here:</p>
<ol>
<li>The user’s machine must be on.</li>
<li>File sharing must be on, to allow for the file to be transferred.</li>
<li>Outlook must not be running on the remote user’s machine. If Outlook is running and has the PST file attached, the file will be locked and unable to be imported.</li>
<li>The PowerShell cmdlet used by Exchange to import PST files does not support passwords.</li>
</ol>
<p>There are various things you could to augment this script.Some suggestions include:</p>
<ul>
<li> Have WMI shut down Outlook on a remote user’s machine before attempting import http://www.computerperformance.co.uk/vbscript/wmi_process.htm</li>
<li>It could be useful to generate a further file detailing a list of all the PSTs which failed to import, with the reason. These files could have been password protected, or the machine hosting them may have been shut down, or become disconnected since they were identified.</li>
</ul>
<p>I hope you have found this series of articles on manually importing PST files into Exchange 2010 useful. Although, like me, I&#8217;m sure you feel that this is a bit of a mammoth task, particularly for the Powershell novice!</p>
<blockquote><p>To automatically import PST files into Exchange 2010 without Powershell visit:<br />
<a title="PST Importer 2010 - Automatically import PSTs into Exchange 2010" href="http://www.red-gate.com/products/pst_importer_2010/?utm_source=sysadmintalk" target="_blank">www.red-gate.com/products/pst_importer_2010</a>. Here you can find out more information on PST Importer 2010 and download a free 14 day trial.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/09/importing-psts-into-exchange-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding PST Files on the Network – The Manual Way</title>
		<link>http://sysadmin-talk.org/2010/08/finding-pst-files-on-the-network-the-manual-way/</link>
		<comments>http://sysadmin-talk.org/2010/08/finding-pst-files-on-the-network-the-manual-way/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 13:54:43 +0000</pubDate>
		<dc:creator>James Allison</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[IT Professional]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[PST Files]]></category>
		<category><![CDATA[PST Importer]]></category>
		<category><![CDATA[PST Importing]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[messages]]></category>
		<category><![CDATA[PST]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=506</guid>
		<description><![CDATA[In the last part of this guide the process for importing a local PST file into exchange server was shown. However, in reality it is likely that these PST files are scattered liberally around your network on the hard drives of your users machines as a result of Outlooks personal archiving. Ideally – so that [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a title="How to Import PST Files into Exchange 2010" href="http://sysadmin-talk.org/2010/08/how-to-import-pst-files-into-exchange-2010-the-manual-way/" target="_self">last part of this guide</a> the process for importing a local PST file into exchange server was shown. However, in reality it is likely that these PST files are scattered liberally around your network on the hard drives of your users machines as a result of Outlooks personal archiving. Ideally – so that this process is transparent to your users, you’d like some way of finding all these PST files – pairing them up with their users, and importing them into the appropriate mailbox. Here I show you how.<span id="more-506"></span></p>
<p>To start this, we  can query Active Directory for a list of all the machines attached to your domain. We can then use Windows Management Instrumentation (WMI) to search each of these machines for PST files. The file paths for these PSTs should hopefully give a clue as to which user they belong to, as they will be created in a directory path containing the username by default. We can also grab the file owner file attribute which should correlate with the file path.</p>
<p>This technique requires that all the machines in your network are switched on and accessible by WMI. A list of the machines which could not be queried can be provided as output</p>
<p><strong>Notes about WMI:</strong></p>
<p>By default WMI is blocked by the windows firewall in Windows 7 and 2008 R2. You’ll need to open up the ports on all your users’ machines. This can be done with the ‘netsh’ command, or through a change to group policy.</p>
<p>What are the implications of this? WMI is a powerful beast, and allows remote access to many aspects of a user’s machine. As such it could be considered a security vulnerability&#8230; It’s typically accessed though port 135. This not only permits access to WMI – but also any other DCOM components which may be installed on a machine, open for exploitation by Trojans and the like. Needless to say, the ports are blocked by default for a reason – so require careful consideration of the implications when opening. WMI will also not help you if the machines you wish to tinker with are subject to NAT (Network Address Translation). You’ll be unable to reach these machines. The following script generates a txt file (the filename defined on line 2) of all the computers on your domain to be searched. This can then be edited with notepad to remove those you don’t wish to search.</p>
<p style="padding-left: 60px;"><code>$strCategory = "computer"<br />
$strOutput = "c:\computernames.txt"<br />
$objDomain = New-Object System.DirectoryServices.DirectoryEntry</code></p>
<p style="padding-left: 60px;"><code>$objSearcher = New-Object System.DirectoryServices.DirectorySearcher<br />
$objSearcher.SearchRoot = $objDomain<br />
$objSearcher.Filter = ("(objectCategory=$strCategory)")</code></p>
<p style="padding-left: 60px;"><code>$colProplist = "name"<br />
foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)}</code></p>
<p style="padding-left: 60px;"><code>$colResults = $objSearcher.FindAll()<br />
[bool]$firstOutput = $true<br />
foreach ($objResult in $colResults)<br />
{<br />
$objComputer = $objResult.Properties;<br />
if($firstOutput)<br />
{<br />
Write-output $objComputer.name | Out-File -filepath $strOutput<br />
$firstOutput = $false;<br />
}<br />
else<br />
{<br />
Write-output $objComputer.name | Out-File -filepath $strOutput `<br />
-append<br />
}<br />
}</code></p>
<p>The next script will generate a CSV (Comma separated values) detailing the network paths of the PSTS you need.</p>
<p style="padding-left: 60px;"><code>$strComputers = Get-Content -Path "c:\computernames.txt"<br />
[bool]$firstOutput = $true<br />
foreach($strComputer in $strComputers)<br />
{<br />
$colFiles = Get-Wmiobject -namespace "root\CIMV2" `<br />
-computername $strComputer `<br />
-Query "Select * from CIM_DataFile `<br />
Where Extension = 'pst'"<br />
foreach ($objFile in $colFiles)<br />
{<br />
if($objFile.FileName -ne $null)<br />
{<br />
$filepath = $objFile.Drive + $objFile.Path + $objFile.FileName + "." `<br />
+ $objFile.Extension;<br />
$query = "ASSOCIATORS OF {Win32_LogicalFileSecuritySetting='" `<br />
+ $filepath `<br />
+ "'} WHERE AssocClass=Win32_LogicalFileOwner ResultRole=Owner"<br />
$colOwners = Get-Wmiobject -namespace "root\CIMV2" `<br />
-computername $strComputer `<br />
-Query $query<br />
$objOwner = $colOwners[0]<br />
$user = $objOwner.ReferencedDomainName + "\" + $objOwner.AccountName<br />
$output = $strComputer + "," + $filepath + "," + $user<br />
if($firstOutput)<br />
{<br />
Write-output $output | Out-File -filepath c:\pstdetails.csv<br />
$firstOutput = $false<br />
}<br />
else<br />
{<br />
Write-output $output | Out-File -filepath c:\pstdetails.csv -append<br />
}<br />
}<br />
}<br />
}</code></p>
<p>This script will take as input a text file containing a list of machine names (conveniently the output of the first script), and will generate a csv file of all the pst files found on those machines, and the owners associated with them.</p>
<blockquote><p>Find PST files across your network quickly and easily with PST Importer 2010. To find out more and to download a free 14 day trial please visit:<br />
<a title="PST Importer 2010 - Automatically import PSTs into Exchange 2010" href="http://www.red-gate.com/products/pst_importer_2010/?utm_source=sysadmintalk" target="_blank">www.red-gate.com/products/pst_importer_2010</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/08/finding-pst-files-on-the-network-the-manual-way/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Finding Stale Accounts in AD with Windows PowerShell</title>
		<link>http://sysadmin-talk.org/2010/02/finding-stale-accounts-in-ad-with-windows-powershell/</link>
		<comments>http://sysadmin-talk.org/2010/02/finding-stale-accounts-in-ad-with-windows-powershell/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 10:29:12 +0000</pubDate>
		<dc:creator>Ben Lye</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows PowerShell]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=144</guid>
		<description><![CDATA[In an Active Directory domain running at the Windows Server 2003 or higher functional level  the lastLogonTimestamp attribute can be used to find out if a user or computer has logged on to the domain recently.  This can be useful information for finding inactive user and computer accounts so that they can be removed from [...]]]></description>
			<content:encoded><![CDATA[<p>In an Active Directory domain running at the Windows Server 2003 or higher functional level  the <strong>lastLogonTimestamp</strong><em> </em>attribute can be used to find out if a user or computer has logged on to the domain recently.  This can be useful information for finding inactive user and computer accounts so that they can be removed from AD.<span id="more-144"></span></p>
<p>The <strong>lastLogonTimestamp</strong> attribute is replicated across all DCs, and it’s important to understand that it does not contain the exact time and date at which the account last logged on.  Instead there is an algorithm which is used to determine when the attribute should be updated, which by default means that the timestamp in <strong>lastLogonTimestamp</strong> could be up to 14 days old.</p>
<p>To understand the algorithm you need to know that there is a configurable attribute in AD called <strong>msDS-LogonTimeSyncInterval</strong>, which controls the granularity of updates to <strong>lastLogonTimestamp</strong>.  By default it is not set, which means that the default value of 14 is used.  There is also some randomization involved to ensure that simultaneous updates from many accounts don’t cause large replication loads on the DCs.  The randomization factor is a random percentage of 5 days.</p>
<p>The algorithm means that when a user or computer logs on the <strong>lastLogonTimestamp</strong> is only updated if the current value of <strong>lastlogonTimestamp</strong> is older than ([current date] &#8211; [14 days] + [random percentage of 5 days]).  This means that the value of <strong>lastLogonTimestamp</strong> for an active account could be anything from 9-14 days old.</p>
<p>The last thing to know about <strong>lastLogonTimestamp</strong> is that the value is stored in UTC format as a large integer, so needs some manipulation to get into human-readable form.</p>
<p>Now that we understand how the attribute works we can use it to do something useful, like find all enabled computer accounts in the domain which have not logged on for 60 or more days.  PowerShell is particularly suited to this because it has built-in methods for doing the date conversions.</p>
<p><code># Calculate the UTC time 60 days ago, in      FileTime (Integer) format and convert it to a string</code></p>
<p><code>$LLTSlimit =      (Get-Date).AddDays(-60).ToFileTimeUTC().ToString()</code></p>
<p><code># Create the LDAP filter for the AD query</code></p>
<p><code># Searching for enabled computer accounts      which have lastLogonTimestamp older than 60 days</code></p>
<p><code>$LDAPFilter = "(&amp;(objectCategory=Computer)(lastlogontimestamp&lt;=$LLTSlimit)      (!(userAccountControl:1.2.840.113556.1.4.803:=2)))"</code></p>
<p><code># Create an ADSI Searcher to query AD</code></p>
<p><code>$Searcher = new-object      DirectoryServices.DirectorySearcher([ADSI]"")</code></p>
<p><code>$Searcher.filter = $LDAPFilter</code></p>
<p><code># Execute the query</code></p>
<p><code>$Accounts = $Searcher.FindAll()</code></p>
<p><code># Process the results</code></p>
<p><code>If ($Accounts.Count –gt 0) {</code></p>
<p><code>#      Create an array to store all the results</code></p>
<p><code>$Results      = @()</code><br />
<code><br />
#      Loop through each account</code><br />
<code><br />
ForEach      ($Account in $Accounts) {</code><br />
<code><br />
#      Create an object to store this account in</code></p>
<p><code>$Result      = "" | Select-Object Name,ADSPath,lastLogonTimestamp</code></p>
<p><code>#      Add the name to the object as a string</code></p>
<p><code>$Result.Name      = [String]$Account.Properties.name</code></p>
<p><code>#      Add the ADSPath to the object as a string</code></p>
<p><code>$Result.ADSPath      = [String]$Account.Properties.adspath</code></p>
<p><code>#      Add the lastLogonTimestamp to the object as a readable date</code></p>
<p><code>$Result.lastLogonTimestamp      = `</code><br />
<code><br />
[DateTime]::FromFileTime([Int64]::Parse($Account.Properties.lastlogontimestamp))</code><br />
<code><br />
#      Add this object to our array</code><br />
<code><br />
$Results      = $Results + $Result</code></p>
<p><code>}</code></p>
<p><code>}</code><br />
<code><br />
# Output the results</code></p>
<p><code>$Results | Format-Table -autosize</code></p>
<p>Extending this script to disable the discovered accounts is as easy as adding this code snippet to the end:</p>
<p><code># Disable each      account</code></p>
<p><code>ForEach ($Result      in $Results) {</code></p>
<p><code>$ADSIAccount = [ADSI]$Result.ADSPath</code></p>
<p><code>$ADSIAccount.PSBase.InvokeSet("AccountDisabled",      "True")</code></p>
<p><code>$ADSIAccount.SetInfo()</code></p>
<p><code>}</code></p>
<p>The <strong>lastLogonTimestamp</strong> attribute is useful for system administrators to understand, and because PowerShell can handle all the type conversions and date arithmetic, it is a great tool to use when working with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/02/finding-stale-accounts-in-ad-with-windows-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

