The Windows PowerShell Snap-In for IIS 7.0

03/19/2010

PowerShell

If you were ever tasked with MOSS 2007 administration, then you know all about frequenting IIS manager to assist with various functions. You even know that just about whenever you install something in the farm you will be ending it with a command prompt and typing IISReset. Well, in the new SharePoint 2010 world, we have this amazing PowerShell tool. As you get comfortable learning the ins and outs of running SharePoint related cmdlets (PowerShell commands), the next step would be to launch the snap-in for IIS 7. This snap-in provides numerous valuable information and task based cmdlets to add to your arsenal. The next several posts will be related to what commands you can utilize within PowerShell to interact with IIS 7. However, let’s first see how to load the snap-in:

The module needed to run IIS 7 PowerShell commands is installed (but not loaded) when you add the Web Server (IIS) role in either Windows Server 2008 or Windows Server 2008 R2. In order to load the module and access the commands for IIS 7, you need to right-click on the PowerShell icon located in the taskbar and select “Import system modules”. If you just want to import the module for IIS, then you can simply open up PowerShell and type Import-Module WebAdministration. However, I like to do them all – you’ll know why at the end.

This will load a PowerShell console and import the system modules, including the IIS 7 module named “WebAdministration”

Once completed, you can now run this command to see a list of all available IIS 7 PowerShell commands:

You now have the Windows PowerShell Snap-In for IIS 7 loaded! Take a look around at the commands available. Type a command and then add “-?” after it to get a description of the command function.

…and if you looked quick enough, you saw:

That’s right, the SharePoint 2010 PowerShell module was also loaded – meaning, you can now interact with IIS 7 and SharePoint 2010 in the same console!

Advertisements

Subscribe

Subscribe to our RSS feed and social profiles to receive updates.

Trackbacks/Pingbacks

  1. Backup IIS Configuration Settings via PowerShell « SP2010 Blog - 04/01/2010

    […] The Windows PowerShell Snap-In for IIS 7.0 […]

  2. California Website Design - 08/15/2011

    California Website Design…

    The Windows PowerShell Snap-In for IIS 7.0 « SP2010 Blog…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: