<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Tom Moser's TechNet Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/tommos/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/tommos/feed.xml</link>
    <description>Where the content is 100% more original than the name</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:36:01 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>AskPFEPlat Post for removing ADMs and Implementing the Central Store</title>
      <link>https://docs.microsoft.com/archive/blogs/tommos/askpfeplat-post-for-removing-adms-and-implementing-the-central-store</link>
      <pubDate>Mon, 02 Jan 2012 19:50:57 GMT</pubDate>
      <dc:creator><![CDATA[Tom Moser [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/tommos/2012/01/02/askpfeplat-post-for-removing-adms-and-implementing-the-central-store/</guid>
      <description><![CDATA[This post is a few weeks old by now, but I thought I'd cross-post it anyway. Mark and I worked on...]]></description>
      <content:encoded><![CDATA[<p>This post is a few weeks old by now, but I thought I'd cross-post it anyway. <a title="Mark" href="http://social.technet.microsoft.com/profile/mark%20morowczynski%20%5Bmsft%5D/">Mark</a> and I worked on the post after having a brief discussion about a few customers who were hesitant to remove the old ADMs. Check it out: <a href="http://blogs.technet.com/b/askpfeplat/archive/2011/12/12/how-to-implement-the-central-store-for-group-policy-admin-templates-completely-hint-remove-those-adm-files.aspx">http://blogs.technet.com/b/askpfeplat/archive/2011/12/12/how-to-implement-the-central-store-for-group-policy-admin-templates-completely-hint-remove-those-adm-files.aspx</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Enumerating Free Disk Space on Remote Computers...with PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/tommos/enumerating-free-disk-space-on-remote-computers-with-powershell</link>
      <pubDate>Sat, 03 Dec 2011 14:50:00 GMT</pubDate>
      <dc:creator><![CDATA[Tom Moser [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/tommos/2011/12/03/enumerating-free-disk-space-on-remote-computers-with-powershell/</guid>
      <description><![CDATA[Here's a quick one for Saturday. A friend of mine mentioned that he was looking for a way to...]]></description>
      <content:encoded><![CDATA[<p>Here's a quick one for Saturday. A friend of mine mentioned that he was looking for a way to enumerate free disk space on remote computers and was hoping to use PowerShell. Instead of just emailing him the script, I thought I'd post it here.</p>
<p>First, we need to decide how to enumerate information about a remote machine... and what better way than WMI. Enter: <strong>Get-WmiObject</strong><em>.&nbsp;</em>If you take a second to fire up your PowerShell console and run <em>Get-Help Get-WmiObject, </em>you should see something like this, hopefully without the red arrow.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/3660.get-helpget-wmiobject.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/3660.get_2D00_helpget_2D00_wmiobject.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/3660.get-helpget-wmiobject.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/3660.get_2D00_helpget_2D00_wmiobject.png" /></a></p>
<p>Based on that syntax, and the conspicuous red arrow, you can see that we're able to use -computername and a string <em>array (</em>hence the&nbsp;two brackets)&nbsp;to connect to remote machines. The array part is important. What it means is that we're able to use -computername and a single&nbsp;name after, <strong>or</strong> we can use -computername and a <em>comma-separated </em>list of computers. We could also create an array prior to running the command at all, and pass that in.</p>
<p><span style="text-decoration: underline;"><span style="font-size: medium;"><strong>Comma Separated List</strong></span></span></p>
<p>In the screen snip below, you can see that I'm able to pass a comma separated list to Get-WmiObject to find the free disk space on each of my DCs. Pretty straightforward.</p>
<p><strong><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/8802.comma-separated.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/8802.comma_2D00_separated.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/8802.comma-separated.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/8802.comma_2D00_separated.png" /></a></strong></p>
<p><span style="text-decoration: underline;"><span style="font-size: medium;"><strong>Pre-Defined Array</strong></span></span></p>
<p>In this next example, I demonstrate the use of an array, stored in a variable, then passed to the Get-WmiObject cmdlet. What I've done is created a variable called <strong>$computers, </strong>then, using the array syntax, I add 4 strings to the array. Boom. A variable of type string[].&nbsp;I run the Get-WmiObject cmdlet just like I did in the previous example, except after -computer (which is short for -computername, and valid to use), I pass in the $computers array.</p>
<p>For more on Arrays, type <em>get-help about_arrays </em>in your PowerShell console.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/0243.array-list.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/0243.array_2D00_list.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/0243.array-list.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/0243.array_2D00_list.png" /></a></p>
<p><span style="font-size: medium;"><strong><span style="text-decoration: underline;">Where-Object</span></strong></span></p>
<p>&nbsp;At this point you can see how to connect to multiple machines using Get-WmiObject, and how to get a list of all of the physical disks. We'll use what we've done so far to make the list a bit more readable. Unless you're living in the early&nbsp;90s, you probably aren't concerned about the A drive. Also, the D drive, which in this case is optical media, isn't needed on the report.&nbsp;Using <em>Where-Object, </em>we can filter out those device types, or more specifically, only include the hard disks. To do that, we simply pipe the Get-WmiObject result to Where-Object and set the condition so that we only get back DriveType 3. It looks like this:</p>
<p><strong>Get-WmiObject win32_logicaldisk -computername $computers | Where-Object { $_.DriveType -eq 3 }</strong></p>
<p>As you probably guessed, that'll give us only fixed disks. Try it out yourself. I'll wait.</p>
<p>Ultimately, you could filter on anything there. You could change it to say <strong>Where-Object { $_.FreeSpace -lt 5GB }. </strong>That will only show servers where free disk space is less than five gigabytes (Side Note: Type <strong>5GB, </strong>or<strong> 1MB, </strong>or<strong> 1024KB </strong>in your console and see what you get!)</p>
<p>Pretty cool, isn't it? But, you want a report of MANY computers <strong>and</strong> you want it to readable and sortable and sendable to managementable. That's understandable. Simple!</p>
<p><span style="font-size: medium; text-decoration: underline;"><strong>Export-Csv</strong></span></p>
<p>With what you've done to this point, you can use the <em>Export-Csv </em>cmdlet to send the results of your query off to a spreadsheet. And who doesn't like spreadsheets? We take that bolded one-liner we ran above, and tack on one more thing:</p>
<p><strong>Get-WmiObject win32_logicaldisk -computername $computers | Where-Object { $_.DriveType -eq 3 } | <em>Export-Csv C:\temp\MyDiskSpace.Csv</em></strong></p>
<p>Now, open up that spreadsheet and what have you got? I'll tell you what you've got: Goo.</p>
<p><br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/8270.goo-csv.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/8270.goo_2D00_csv.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/8270.goo-csv.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/8270.goo_2D00_csv.png" /></a></p>
<p>Ok, that's not totally true. When you use a cmdlet such as Export-Csv (or Format-List *, or Format-Wide *, etc) it'll output all of the properties on that PowerShell object. In our case here, we dumped out every single property on the win32_LogicalDisk object. Management won't like that. And PowerShell was just doing what you told it to do. Now let's clean it up a bit.</p>
<p><span style="font-size: medium; text-decoration: underline;"><strong>Select-Object</strong></span></p>
<p>Since we're just looking at free disk space on the disks, we probably only need the computer name, the drive letter, free space, total space, and for kicks we'll throw in the volume name. Looking at the spreadsheet that was just generated makes it easy to map out those values and what the property name will be&nbsp;on the object in PowerShell.</p>
<ul>
<li>Computer Name&nbsp;= SystemName</li>
<li>Drive Letter = DeviceID</li>
<li>Volume Name&nbsp;= VolumeName</li>
<li>Free Space = FreeSpace</li>
<li>Total Space = Size</li>
</ul>
<p>By consulting <em>get-help export-csv -full</em>&nbsp;you can see that there's a way to get only those properties in to the output. <strong>Select-Object.</strong> If we pipe the result of our filtered Get-WmiObject cmdlet to Select-Object and <strong>then</strong> export to a csv, maybe we'll get somewhere.</p>
<p><strong>Get-WmiObject win32_logicaldisk -computername $computers | Where-Object { $_.DriveType -eq 3 } | Select-Object SystemName,DeviceID,VolumeName,FreeSpace,Size |&nbsp;Export-Csv C:\temp\MyDiskSpace.Csv</strong></p>
<p>Now if we open up the resulting CSV in notepad, we get something a bit more useful. It'll be even more useful when you open it up in Excel, add some colors, and ship it off to the powers-that-be to show them exactly why you need to add 10TB to the SAN.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/0284.winner.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/0284.winner.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/0284.winner.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/0284.winner.png" /></a></p>
<p>It's also worth mentioning that if you don't want that TYPE header in the CSV, you can add <em>-NoTypeInformation</em> to <strong>Export-Csv </strong>and it won't be in the CSV.</p>
<p><span style="font-size: medium;"><strong><span style="text-decoration: underline;">Conclusion</span></strong></span></p>
<p>Based on everything I've showed you, I hope that you've got a better understanding of how to get information from a remote computer, filter that information based on certain criteria, extract just the pieces of information you need, then how to export that to a more friendly, readable CSV file, all with one line.</p>
<p><span style="font-size: small;">-Tom </span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<p></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Managing Active Directory via PowerShell: Sites</title>
      <link>https://docs.microsoft.com/archive/blogs/tommos/managing-active-directory-via-powershell-sites</link>
      <pubDate>Mon, 24 Oct 2011 10:38:00 GMT</pubDate>
      <dc:creator><![CDATA[Tom Moser [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/tommos/2011/10/24/managing-active-directory-via-powershell-sites/</guid>
      <description><![CDATA[Last time, I did a brief introduction on using the Active Directory PowerShell module. In this post,...]]></description>
      <content:encoded><![CDATA[<p>Last time, I did a brief introduction on using the Active Directory PowerShell module. In this post, I will cover how you go about creating sites in Active Directory by using PowerShell.</p>
<p>In the intro post, we had a new AD domain controller in the new Contoso.com (surprise!) forest. At this point, to make a real AD forest, we would want to add some additional DCs and maybe some sites, put some subnets on those sites, then create site links to enable replication between the locations.&nbsp; Let's start by adding sites.</p>
<p><strong><span style="text-decoration: underline;">Adding AD Sites</span></strong></p>
<p>Normally, you'd go to AD Sites and Services and simply create the new site there. Following that, you'd edit the site link cost and replication interval, and be on your way. By default, you'd probably put the site in the default site link, or a temporary site link until you were able to create a new dedicated site link. In the next few posts, we'll do that in a little different order, and with PowerShell.</p>
<p>First, open up PowerShell and execute import-module ActiveDirectory to import the AD module (the AD tools need to be on the machine, or you need to be on a 2008 R2 DC). Since there isn't a cmdlet specifically for creating sites, we need to use the generic New-ADObject cmdlet. Right now, you should type get-help New-ADObject -full in PowerShell and read through the help. I'll wait.</p>
<p>Great, now that you've read through that, you don't need to read the rest of this post...if you're only creating a subnet, contact, or container. Based on what you saw in the help, you can see that the New-ADObject cmdlet requires a few things. First, you need to specify the type of object you'd like to create. In this first example, it's pretty simple: Site. Next, you need a name for the object. Since we're creating a site, we'll call this first one something descriptive like "HQ." Finally, you need to specify a path for the new object. You're probably thinking "But, Tom, I'm creating a site, why doesn't it go in the Sites container?"</p>
<p>Good question, I'm glad you asked. Since you're using a generic object creation cmdlet to create any type of object you want, you need to specify where you want to create it. A good example of this is a user. If I were using this cmdlet to add a user, I'd need to specify the OU or container where I want that user to live. The same goes for sites (Side note: You can place sites in another container if you've created a custom sitesContainer. Don't do that). I need to tell it to use the CN=Sites,CN=Configuration,DC=Contoso,DC=com path so it uses the proper container in the configuration partition.</p>
<p>Let's do it.</p>
<p><strong><em>New-ADObject -type Site -name "HQ" -path "CN=Sites,CN=Configuration,DC=Contoso,DC=com"</em></strong></p>
<p>The Result:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/0572.new-adobject-site.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/0572.new_2D00_adobject_2D00_site.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/0572.new-adobject-site.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/0572.new_2D00_adobject_2D00_site.png" /></a></p>
<p>Well, that was anti-climactic.</p>
<p>But, if we follow that up with a Get-ADObject...</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/4606.new-adobject-win.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/4606.new_2D00_adobject_2D00_win.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/4606.new-adobject-win.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/4606.new_2D00_adobject_2D00_win.png" width="558" height="101" /></a></p>
<p>Solid. You've got a site. Problem: Open AD Sites and Services and compare it to your other sites. What's missing? I hope you said the Servers container and NTDS Site Settings object.</p>
<p>If you look in ADSIEdit at the object type for the NTDS Site Settings or Servers container under Sites in the Config partition, you'll see ntdsSiteSettings and ServersContainer as the classes, respectively. That means for the type in our command, we need to use those. Since these objects belong in the specific site container (ie, HQ), we need to use that for the path.</p>
<p><em><strong>New-ADObject -type ServersContainer -name "Servers" -path "CN=HQ,CN=Sites,CN=Configuration,DC=Contoso,DC=Com"</strong></em></p>
<p><em><strong>New-ADObject -type ntdsSiteSettings -name "NTDS Site Settings" -path "CN=HQ,CN=Sites,CN=Configuration,DC=Contoso,DC=Com"</strong></em></p>
<p>If you check out sites and service now, you'll see a site where you could drop a DC and you'll see the NTDS Site Settings object. If you move a DC in to the site and check properties on the NTDS Site Settings object, you should see the ISTG for the site is now your DC. Good work!</p>
<p><span style="text-decoration: underline;"><strong>Conclusion</strong></span></p>
<p>Originally, I had planned to make this post about adding sites, subnets, and site links. I felt it was more important to focus on the New-ADObject cmdlet itself instead of just "how to do it." Creating sites in PowerShell isn't something you'll do much, but it's important to understand how it works, since some of the following posts may&nbsp;cover things you need to do regularly or automate. In the next post, I'll go deeper on the New-ADObject cmdlet and demonstrate some techniques that will be useful anywhere in PowerShell.&nbsp;</p>
<p>-Tom&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Managing Active Directory via PowerShell: Introduction</title>
      <link>https://docs.microsoft.com/archive/blogs/tommos/managing-active-directory-via-powershell-introduction</link>
      <pubDate>Mon, 12 Sep 2011 11:54:00 GMT</pubDate>
      <dc:creator><![CDATA[Tom Moser [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/tommos/2011/09/12/managing-active-directory-via-powershell-introduction/</guid>
      <description><![CDATA[As a platforms PFE, I&nbsp;spend a good deal of my time at customer sites&nbsp;working with Active...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">As a platforms PFE, I&nbsp;spend a good deal of my time at customer sites&nbsp;working with Active Directory administrators. During my travels, I've found that many AD admins are either unaware of what Server 2008 R2 brings to the table with PowerShell and AD, or they're afraid to use it due to the perceived&nbsp;learning curve associated with&nbsp;PowerShell. I spoke with an administrator a few months ago who had manually enabled accidental deletion protection across several hundred OUs - one at a time. He spent several days doing something that could have been done in moments with a one line PowerShell script. </span></p>
<p><span style="font-size: small;">My goal with this series of posts is to outline the requirements of using the Active Directory PowerShell module, and then to show examples of&nbsp;different administrative tasks. By the end of the series, I hope that a reader will feel comfortable with using this module to manage their own AD environment. So let's get to it.</span></p>
<p><span style="font-size: medium; text-decoration: underline;">Requirements</span></p>
<ul>
<li><span style="font-size: small;">The AD PowerShell module requires a Server 2008 R2 DC in your environment, unless you follow Ashley's guide located <a href="http://blogs.technet.com/b/ashleymcglone/archive/2011/03/17/step-by-step-how-to-use-active-directory-powershell-cmdlets-against-2003-domain-controllers.aspx" target="_blank">here</a>.</span></li>
<li><span style="font-size: small;">The AD Web Services service needs to be running on at least one DC in the environment. Read more about ADWS <a href="http://technet.microsoft.com/en-us/library/dd391908(WS.10).aspx" target="_blank">here</a>.</span></li>
</ul>
<p><span style="font-size: small;">During this series, I will start with a new forest running a single Windows Server 2008 R2 domain controller. From there, I'll show how to create subnets, sites, users, groups, and more - all with PowerShell. If you don't have a test environment built, I recommend doing that before starting. You'll want a sandbox where you can add and remove objects without worrying about breaking something in production. Go ahead and build that now... I'll wait.</span></p>
<p><span style="font-size: small;"></span>&nbsp;</p>
<p><span style="font-size: small;"></span>&nbsp;</p>
<p><span style="font-size: small;">Ok, now that you've got your brand new test lab running a single Windows Server 2008 R2 domain controller, log on to the DC.&nbsp;There are a few different ways to load up the Active Directory module. </span><span style="font-size: small;">The first way to load the AD Module is to click <em>Start</em>, go to <em>Administrative</em> <em>Tools</em>, and find "<em>Active Directory Module for Windows PowerShell</em>." That will start PowerShell and automatically load the module. That requires too many clicks for my liking, so I generally hit the shortcut on the taskbar and type <em>Import-Module ActiveDirectory</em>. It should look like this:</span></p>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/2438.ADWSFail.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/2438.ADWSFail.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/2438.ADWSFail.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/2438.ADWSFail.png" /></a></span></p>
<p><span style="font-size: small;">Now, you <em>might </em>see that error message. If you do, no worries. The message is telling you exactly what you think it's telling you: ADWS isn't running. Assuming you're logged on to the 2008 R2 DC, you could just use <em>net start </em>to start the service...but this is a series about PowerShell. To verify the state of the service, utilize the <em>get-service</em> cmdlet. </span></p>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/7411.StartADWS.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/7411.StartADWS.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/7411.StartADWS.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/7411.StartADWS.png" /></a></span></p>
<p><span style="font-size: small;">Running that cmdlet shows that the service is stopped. Using <em>start-service, </em>we can start the service, then unload and import the module again. </span></p>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/4606.reimportADModule.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/4606.reimportADModule.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/4606.reimportADModule.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/4606.reimportADModule.png" /></a></span></p>
<p><span style="font-size: small;">And now you've successfully imported the AD module for PowerShell. </span></p>
<p><span style="font-size: medium; text-decoration: underline;">Conclusion </span></p>
<p><span style="font-size: small;">At this point, you've got at least one Windows Server 2008 R2 domain controller running the AD web service and are successfully able to import the AD&nbsp;PowerShell module. If you want to verify that it's working, you can use the AD <a href="http://technet.microsoft.com/en-us/library/dd315335.aspx" target="_blank">PSDrive Provider</a> to do a quick check.</span></p>
<p><span style="font-size: small;">The PSDrive is just what is sounds like: A "drive" that is mapped to AD. To get to the AD PSDrive, you simply type <em>cd AD:</em>&nbsp;and hit enter. That's it. Once you're there, type <em>get-childitem </em>and you should see a list of all naming contexts found on that DC.</span></p>
<p><span style="font-size: small;"></span><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/6648.CheckPSDrive.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/6648.CheckPSDrive.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/12/6648.CheckPSDrive.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-12/6648.CheckPSDrive.png" width="573" height="171" /></a></p>
<p><span style="font-size: small;">This indicates that ADWS is running, the AD module has been imported, and we're able to retrieve data from the directory. Watch for my next post when I start to describe how to build out your subnets and sites using only PowerShell.</span></p>
<p><span style="font-size: small;"></span>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>My Very Own TechNet Blog</title>
      <link>https://docs.microsoft.com/archive/blogs/tommos/my-very-own-technet-blog</link>
      <pubDate>Thu, 18 Aug 2011 11:32:00 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/tommos/2011/08/18/my-very-own-technet-blog/</guid>
      <description><![CDATA[I think having my own TechNet blog means I've officially made it as a geek.
My name is Tom Moser....]]></description>
      <content:encoded><![CDATA[<p>I think having my own TechNet blog means I've officially made it as a geek.</p>
<p>My name is Tom Moser. I'm a Premier Field Engineer at Microsoft based out of Metro Detroit. My areas of expertise are Platforms, specifically Active Directory,&nbsp;and PowerShell. I've also got some experience in various areas of .NET and C#, but I hesitate to refer to myself as a developer.</p>
<p>I plan to update at least monthly, so stay tuned for random posts on AD, PowerShell, or whatever I happened to have learned or created that week (ok, month).</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>