<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.iis.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Tobin Titus Blog</title><subtitle type="html" /><id>http://blogs.iis.net/tobintitus/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.iis.net/tobintitus/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2006-11-30T20:09:00Z</updated><entry><title>Accessing Custom Configuration at Runtime with Microsoft.Web.Administration</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2008/06/13/accessing-custom-configuration-at-runtime-with-microsoft-web-administration.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2008/06/13/accessing-custom-configuration-at-runtime-with-microsoft-web-administration.aspx</id><published>2008-06-13T19:07:00Z</published><updated>2008-06-13T19:07:00Z</updated><content type="html">I've been working on a series of posts and Webcasts in my "spare time" directed at some of the areas in which I am most frequently asked questions. I am currently working on developing topics dealing with IIS configuration. It seems logical that this would bring me a great deal of questions considering that IIS 7.0 is using a completely different configuration system than it did in previous versions. That said, I wanted to follow up to my Webcast (" Extending IIS Configuration ") with an article...(&lt;a href="http://blogs.iis.net/tobintitus/archive/2008/06/13/accessing-custom-configuration-at-runtime-with-microsoft-web-administration.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2423029" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="IIS 7" scheme="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx" /><category term="IIS" scheme="http://blogs.iis.net/tobintitus/archive/tags/IIS/default.aspx" /><category term="Microsoft.Web.Administration" scheme="http://blogs.iis.net/tobintitus/archive/tags/Microsoft.Web.Administration/default.aspx" /></entry><entry><title>Webcast: Extending IIS Configuration</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2008/06/01/webcast-extending-iis-configuration.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2008/06/01/webcast-extending-iis-configuration.aspx</id><published>2008-06-01T07:05:00Z</published><updated>2008-06-01T07:05:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;I'm happy to report that&amp;nbsp;my first webcast has been published to IIS.NET. &lt;/P&gt;
&lt;P mce_keep="true"&gt;For those of you that prefer to learn by watching a feature being used over reading an article, I will be trying to do one or two of these a month.&lt;/P&gt;
&lt;P mce_keep="true"&gt;You may download the WMV file &lt;A class="" title=here href="http://mediadl.microsoft.com/mediadl/IISNET/Media/IIS%207.0%20-%20Extending%20Existing%20Configuration.wmv" mce_href="http://mediadl.microsoft.com/mediadl/IISNET/Media/IIS%207.0%20-%20Extending%20Existing%20Configuration.wmv"&gt;here&lt;/A&gt;, or watch the video in our &lt;A class="" title=Silverlight href="http://silverlight.net/" mce_href="http://silverlight.net/"&gt;Silverlight&lt;/A&gt; player &lt;A class="" title=here href="http://learn.iis.net/page.aspx/471/extending-iis-configuration" mce_href="http://learn.iis.net/page.aspx/471/extending-iis-configuration"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;I'm welcoming any and all feedback so that I can improve these webcasts down the road. Current my biggest feedback is to reduce the amount of keyboard and mouse clicking noises during the video. I'll be doing that by getting an external mic as soon as possible. Please let me know if you would prefer my head is in or out of the video. I've been given opinions both ways so I'm welcome to more feedback. &lt;/P&gt;
&lt;P mce_keep="true"&gt;Thanks again for your support, and happy coding!&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2392952" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="configuration webcast extensibility" scheme="http://blogs.iis.net/tobintitus/archive/tags/configuration+webcast+extensibility/default.aspx" /></entry><entry><title>Back in business... but I need your input!</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/11/29/back-in-business-but-i-need-your-input.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/11/29/back-in-business-but-i-need-your-input.aspx</id><published>2007-11-29T16:38:00Z</published><updated>2007-11-29T16:38:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;It has been quite a while since my last post to my blog. For the past several months, I had been working on an internal project with Microsoft that has kept me very busy.&amp;nbsp; That said, the past month has also proved to be very interesting for me. I decided to move back to sunny Charleston, South Carolina.&amp;nbsp; My management has been very supportive in this decision. I am currently working from my home in &lt;A class="" title="Ladson, South Carolin" href="http://en.wikipedia.org/wiki/Ladson%2C_SC" mce_href="http://en.wikipedia.org/wiki/Ladson%2C_SC"&gt;Ladson, South Carolina&lt;/A&gt;.&amp;nbsp; For those of you familiar with the area, you might recognize this as being right next door to North Charleston, South Carolina -- the &lt;A class="" title="7th most dangerous city in the country" href="http://www.charleston.net/news/2007/nov/19/n_charleston_crime_th_u_s22661/" mce_href="http://www.charleston.net/news/2007/nov/19/n_charleston_crime_th_u_s22661/"&gt;7th most dangerous city in the country&lt;/A&gt; according to FBI crime statistics. You might also recognize this as being very close to the data center that Google is building in &lt;A class="" title="Moncks Corner, SC" href="http://en.wikipedia.org/wiki/Moncks_Corner" mce_href="http://en.wikipedia.org/wiki/Moncks_Corner"&gt;Moncks Corner, SC&lt;/A&gt;.&amp;nbsp; I can't tell you how many times I've been asked if Microsoft is going to build a competing data center down here. The mere presence of a Microsoft employee down here seems to stir many rumors. Let me put those rumors to rest.&amp;nbsp; I am here on my own and as far as I know, Microsoft has no plans to build anything here.&amp;nbsp;Had Microsoft not allowed me to work from here, I would no longer be working for Microsoft.&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Having addressed that issue, I'm excited to announce that I'll finally be back to developing content for IIS.NET and for our fantasitc IIS community.&amp;nbsp; I will also be trying to attend the &lt;A class="" title=.NET href="http://www.gspdevelopers.org/" mce_href="http://www.gspdevelopers.org/"&gt;.NET&lt;/A&gt; &lt;A class="" title=user href="http://www.dotnetcolumbiasc.org/" mce_href="http://www.dotnetcolumbiasc.org/"&gt;user&lt;/A&gt; &lt;A class="" title=groups href="http://www.gcnug.org/" mce_href="http://www.gcnug.org"&gt;groups&lt;/A&gt; &lt;A class="" title=on href="http://www.developersguild.org/" mce_href="http://www.developersguild.org/"&gt;on&lt;/A&gt; the east coast to talk about IIS 7 both for Developers and the IT Pro audience.&amp;nbsp; I'll be contacting the immediate .NET groups in South Carolina and Charlotte to announce my presence and availability as a speaker.&amp;nbsp; If you run a user group outside this area and would like presentation on IIS 7, please feel free to contact me and I'll see what can be arranged.&lt;/P&gt;
&lt;P mce_keep="true"&gt;What I will be doing down here in Charleston is not completely set in stone.&amp;nbsp; While I do intend to be creating some great samples, and related articles/webcasts, I will also be involved with some other community and content-related projects.&amp;nbsp; So wht kind of samples, articles and webcasts will I be doing?&amp;nbsp; We have some ideas, but I'd like to get some ideas from the community in general. What pain-points are you having? What kind of samples would you like to see? Are there integration issues your company is strugling with?&amp;nbsp; Are you not sure where to begin and what roadmap you should be taking to learning the ins-and-outs of IIS 7?&amp;nbsp;Please speak up and let me know where I can help you.&amp;nbsp;While I cannot promise I have all the answers, I will do my best to get you the answers you need and perhaps some awesome samples to go with it.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;Thanks for listening, and thanks in advance for your ideas!&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2032956" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="East Coast" scheme="http://blogs.iis.net/tobintitus/archive/tags/East+Coast/default.aspx" /><category term="Content" scheme="http://blogs.iis.net/tobintitus/archive/tags/Content/default.aspx" /><category term="Charleston" scheme="http://blogs.iis.net/tobintitus/archive/tags/Charleston/default.aspx" /><category term="South Carolina" scheme="http://blogs.iis.net/tobintitus/archive/tags/South+Carolina/default.aspx" /><category term="Welcome" scheme="http://blogs.iis.net/tobintitus/archive/tags/Welcome/default.aspx" /></entry><entry><title>Mix Updates - My Status</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/04/30/mix-updates-my-status.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/04/30/mix-updates-my-status.aspx</id><published>2007-04-30T19:51:00Z</published><updated>2007-04-30T19:51:00Z</updated><content type="html">For those of you that care to follow this stuff, check out my Mix07 updates on &lt;A class="" href="http://www.twitter.com/tobint"&gt;Twitter&lt;/A&gt;, my pictures on &lt;A class="" href="http://www.flickr.com/photos/8050442@N02/tags/mix07/"&gt;Flickr&lt;/A&gt;, and my errr... other stuff on &lt;A class="" href="http://www.facebook.com/profile.php?id=564541454"&gt;Facebook&lt;/A&gt;.&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1688890" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="MIX07" scheme="http://blogs.iis.net/tobintitus/archive/tags/MIX07/default.aspx" /></entry><entry><title>Silverlight and Expression and Bears, oh my!</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/04/30/silverlight-and-expression-and-bears-oh-my.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/04/30/silverlight-and-expression-and-bears-oh-my.aspx</id><published>2007-04-30T16:53:00Z</published><updated>2007-04-30T16:53:00Z</updated><content type="html">&lt;P&gt;I just watched some of the coolest demos I've seen in a while.&amp;nbsp; Ray Ozzie gave the opening keynote address for Mix 07. I hate to say it but he stated nothing more than the obvious direction of technology, IMHO.&amp;nbsp;Ray's address was quickly followed by Scott Guthrie who received a very warm greeting -- and rightly so! Scott was there to deliver the goodies which were also received very warmly.&amp;nbsp; There were plenty of announcements about Silverlight and the driection we are headed there. The big impressive thing we announced was our cross-platform CLR support and the integration of .NET into Silverlight as a programming model.&amp;nbsp; I loved watching the demo's of using Expression to create the user experience and Visual Studio to provide the remote debugging support -- on a Mac none-the-less!&lt;/P&gt;
&lt;P&gt;This is already all too cool for words. I can't wait to see what else is coming up next. Oh wait, that would be Bill Staples demonstration of IIS 7 for developers.&amp;nbsp; If you are at Mix, come join me in room 4101A to learn what IIS 7 has to offer developers.&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1688660" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="IIS 7" scheme="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx" /><category term="MIX07" scheme="http://blogs.iis.net/tobintitus/archive/tags/MIX07/default.aspx" /><category term="Expression" scheme="http://blogs.iis.net/tobintitus/archive/tags/Expression/default.aspx" /><category term="Silverlight" scheme="http://blogs.iis.net/tobintitus/archive/tags/Silverlight/default.aspx" /></entry><entry><title>Heading to Mix</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/04/28/heading-to-mix.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/04/28/heading-to-mix.aspx</id><published>2007-04-29T04:12:00Z</published><updated>2007-04-29T04:12:00Z</updated><content type="html">&lt;P&gt;In just a few short hours, I'll be heading to Las Vegas to attend &lt;A class="" href="http://www.visitmix.com/"&gt;Mix 07&lt;/A&gt;.&amp;nbsp; I'm not sure what to expect but I'm very excited to see our customers in person. I'm probably one of the few who doesn't really enjoy Vegas.&amp;nbsp; However, this time will be different because I'll have the conference to go to. (I'm just wondering if my 18-year-old version of myself is shaking his head at that last statement).&amp;nbsp; In any case, if you are heading to Mix and want to get together to talk about IIS 7, ping me and I'll do my best to find you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you aren't heading to Mix, but want to catch all the excitement, check out the excitement on the &lt;A class="" href="http://www.visitmix.com/Blogs/Joshua/visitmix-from-home/"&gt;visitmix.com&lt;/A&gt; website.&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1686790" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="MIX07" scheme="http://blogs.iis.net/tobintitus/archive/tags/MIX07/default.aspx" /></entry><entry><title>Partying with Palermo</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/03/12/partying-with-palermo.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/03/12/partying-with-palermo.aspx</id><published>2007-03-12T14:50:00Z</published><updated>2007-03-12T14:50:00Z</updated><content type="html">&lt;P&gt;As many know, the &lt;A class="" href="http://mvp.support.microsoft.com/MVPsummit"&gt;Microsoft MVP Global Summit&lt;/A&gt; is happening this week. As if the affair wasn't a big enough deal, &lt;A class="" href="http://codebetter.com/blogs/jeffrey.palermo/archive/2007/02/16/Party-with-Palermo_3A00_-MVP-Global-Summit-edition-_2D00_-official-announcement.aspx"&gt;Jeffrey Palermo&lt;/A&gt; threw a big party at &lt;A class="" href="http://jilliansbilliards.com/club_detail_E.asp?club_id=7"&gt;Jillians&lt;/A&gt; in Seattle.&amp;nbsp; I went last night just to talk to some of this industry's most well known bloggers and influencers who were in attendance.&amp;nbsp; &lt;A class="" href="http://www.neopoleon.com/home/default.aspx"&gt;Rory&lt;/A&gt; even decided&amp;nbsp;to show up -- albeit fashionably late.&amp;nbsp; I was shocked to see so many people show up.&amp;nbsp; With the sponsors taking care of cool books, free software, t-shirts, grab bags, a buffet of free food&amp;nbsp;and an open bar tab I guess I shouldn't be surprised at all!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I brought my camcorder but the crowd was too big to get much of anything useful out of it. I'll try to rip some still images from what I was able to get last night and post them when I can.&amp;nbsp; It was great to get to talk to a few people last night and find out how they were using IIS, what they liked, what they didn't like, and what they want more information about.&amp;nbsp; I'll be sure to get this information in front of the right people.&amp;nbsp; A huge "thank you" goes out&amp;nbsp;to everyone who was willing to talk last night.&lt;/P&gt;
&lt;P&gt;If you are in town for the MVP Global Summit, and you'd like to talk about IIS, please &lt;A class="" href="http://blogs.iis.net/tobintitus/contact.aspx"&gt;email me&lt;/A&gt; and I will be glad to get in touch with you before you leave town.&amp;nbsp; Thanks again.&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1616534" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="MVP" scheme="http://blogs.iis.net/tobintitus/archive/tags/MVP/default.aspx" /><category term="IIS" scheme="http://blogs.iis.net/tobintitus/archive/tags/IIS/default.aspx" /></entry><entry><title>Microsoft Ajax Library on PHP</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/03/05/microsoft-ajax-library-on-php.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/03/05/microsoft-ajax-library-on-php.aspx</id><published>2007-03-05T21:39:00Z</published><updated>2007-03-05T21:39:00Z</updated><content type="html">&lt;P&gt;As you may know, we have already announced that the&amp;nbsp;IIS team was &lt;A class="" href="http://www.iis.net/default.aspx?tabid=1000051"&gt;working with Zend&lt;/A&gt; to improve PHP performance on the Windows platform. While that fact might stand alone as pretty cool, I also found &lt;A class="" href="http://blogs.msdn.com/brada/archive/2007/03/04/microsoft-ajax-library-on-php.aspx"&gt;this link&lt;/A&gt; on Brad Abrams blog about an &lt;A class="" href="http://codeplex.com/phpmsajax"&gt;Microsoft Ajax library for PHP&lt;/A&gt;.&amp;nbsp; I find both of these initiatives to be extremely cool.&amp;nbsp; Look for more information coming soon&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1606091" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="PHP" scheme="http://blogs.iis.net/tobintitus/archive/tags/PHP/default.aspx" /><category term="Ajax" scheme="http://blogs.iis.net/tobintitus/archive/tags/Ajax/default.aspx" /></entry><entry><title>Reading IIS.NET Blogs with Powershell</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/02/13/reading-iis-net-blogs-with-powershell.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/02/13/reading-iis-net-blogs-with-powershell.aspx</id><published>2007-02-13T19:14:00Z</published><updated>2007-02-13T19:14:00Z</updated><content type="html">&lt;P&gt;Being a member of the IIS team, I often find myself checking blog posts to see what the members of the product team are blogging about.&amp;nbsp; However, since Powershell came out, I find myself doing more and more work on my scripts. It's a bit annoying to have to jump out of Powershell to go read blog posts.&amp;nbsp; As such, I've written a few quick scripts to help me read IIS.NET from my pretty blue shell. For those of you who are already familiar with powershell and don't want to read the long blog post, you can download my blog script from the DownloadCENTER: &lt;A href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;g=6&amp;amp;i=1387"&gt;http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;g=6&amp;amp;i=1387&lt;/A&gt;&lt;/P&gt;
&lt;H4&gt;Setting up your Powershell environment&lt;/H4&gt;
&lt;HR&gt;

&lt;P&gt;To start, I've written a few supporting functions in my profile.&amp;nbsp; These functions help me keep my scripts organized and, since I change my scripts quite often, it helps me to sign them as well.&lt;/P&gt;
&lt;P&gt;First off, if you haven't created your own&amp;nbsp;certificate for signing code, please go back and&amp;nbsp;take a look at &lt;A class="" href="http://blogs.iis.net/tobintitus/archive/2006/11/30/powershell-and-microsoft-web-administration.aspx"&gt;my&amp;nbsp;first Powershell blog post&lt;/A&gt; that give you the details on how to do this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, we need to add a few things to your Powershell profile.&amp;nbsp; To open your Powershell profile from within Powershell, type: &lt;/P&gt;
&lt;P class=ConsoleCode&gt;PS &amp;gt; notepad $profile&lt;/P&gt;
&lt;P&gt;First, I add a function to allow us to easily sign our scripts (assuming you have created a cert to sign them wth):&lt;/P&gt;&lt;PRE class=ExampleCode&gt;## Sign a file
##-------------------------------------------
  function global:Sign-Script ( [string] $file )
  {
    $cert = @(Get-ChildItem cert:\CurrentUser\My -codesigning)[0]
    Set-AuthenticodeSignature $file $cert
  }
  set-alias -name sign -value sign-script
&lt;/PRE&gt;
&lt;P&gt;The next function is used to help me organize things. I have several scripts for various&amp;nbsp;work environments.&amp;nbsp; I like to organize them by function. So, I keep my IIS scripts in an "IIS" directory, my common scripts in a "common" directory and so on.&amp;nbsp; Inside each of my script directories, I keep a "load.ps1" script that I can&amp;nbsp; use to initialize any of my work environments.&amp;nbsp; Lastly, I create a Powershell drive that matches the work environment name so I can get to my scripts easily. The function below does all the work for me.&lt;/P&gt;&lt;PRE class=ExampleCode&gt;## Create a Drive
##-------------------------------------------
  function global:New-Drive([string]$alias)
  {
    $path = (join-path -path $global:profhome -childpath $alias)
    if( !(Test-Path $path ) ) 
    {
      ## Create the drive's directory if it doesn't exist
      new-item -path $global:profhome -name $alias -type directory
    }
    else
    {
      ## Execute the load script for this drive if one exists
      $loadscript = (join-path -path $path -childpath "load.ps1")
      if( Test-Path  $loadscript)
      {
        $load = &amp;amp;$loadscript
      }
    }
    # Create the drive
    new-Psdrive -name $alias -scope global -Psprovider FileSystem -root $path
  }
&lt;/PRE&gt;
&lt;P&gt;Within my profile, I simply call this function and pass in an alias. When the function executes it will create a directory with the alias name, if it doesn't exist already. If the directory does exist, it will check for the load.ps1 file inside that path and execute it. Lastly, it will create powershell drive. I have the following calls added to my profile below: &lt;/P&gt;&lt;PRE class=ExampleCode&gt;## Custom PS Drives
##-------------------------------------------
  New-Drive -alias "common" 
  New-Drive -alias "iis" 
&lt;/PRE&gt;
&lt;P&gt;Go ahead and save your profile now and type these commands:&lt;/P&gt;
&lt;P class=ConsoleCode&gt;PS &amp;gt; Set-ExecutionPolicy Unrestricted&lt;BR&gt;PS &amp;gt; &amp;amp;$profile&lt;BR&gt;PS &amp;gt; Sign $profile&lt;BR&gt;PS &amp;gt; Set-ExecutionPolicy AllSigned&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;The first command sets Powershell into unrestricted mode. This is because we need to execute the profile script and it hasn't been signed yet.&amp;nbsp; The next command executes the profile. The third command uses the "sign" function that our profile script loaded. Since our profile is now signed, we can set our execution policy back to AllSigned. AllSigned means that Powershell will execute scripts as long as they are signed.&lt;/P&gt;
&lt;P&gt;From this point on, we can make changes to our profile and simply call our sign function again before we close our Powershell instance. The next instance of powershell that is opened will have our changes.&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;Creating / Using Blog Functionality&lt;/H4&gt;
&lt;HR&gt;

&lt;P&gt;Now that we have our environment set up, lets get to the blogging part.&amp;nbsp; If you've set up your environment right, you can execute the following command:&lt;/P&gt;
&lt;P class=ConsoleCode&gt;PS &amp;gt; cd iis:&lt;/P&gt;
&lt;P&gt;This command will put you in the iis scripts directory.&amp;nbsp; Next, create a new blogs script by typing:&lt;/P&gt;
&lt;P class=ConsoleCode&gt;PS &amp;gt; notepad blogs.ps1&lt;/P&gt;
&lt;P&gt;You'll be prompted if you want to create the file. Go ahead and say yes.&amp;nbsp; Next, paste the following into the the notepad and save it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=ExampleCode&gt;## Sets up all custom feeds from feeds.txt
##---------------------------------------------------
function global:Import-Feed
{
  if( $global:RssFeeds -eq $null ) 
  {
    $global:RssFeeds = @{};
  }
  $RssFeeds.Add( "iisblogs",     "http://blogs.iis.net/rawmainfeed.aspx" );
  $RssFeeds.Add( "iisdownloads", "http://www.iis.net/DownloadCENTER/all/rss.aspx" );
}
Import-Feed ## Call Import-Feed so we are ready to go

## Gets a feed or lists available feeds
##---------------------------------------------------
function global:Get-Feed( [string] $name )
{  
  if( $RssFeeds.ContainsKey( $name ) )
  {
    return $RssFeeds[$name];
  }
  else
  {
    Write-Host "The path requested does not exist";
    Write-Output $RssFeeds;
  }
}

## Gets IIS Blogs
##---------------------------------------------------
function global:Get-Blog([int]$index, [int]$last, [int]$first, [int]$open)
{
  $url = (Get-Feed iisblogs)
  return (Get-RSS $url $index $last $first $open)
}

## Gets a specific blog
##---------------------------------------------------
function global:Get-AuthorBlog([string]$creator)
{
  Get-Blog | Where-Object {$_.creator -eq $creator}
}


## Gets Downloads from IIS
##---------------------------------------------------
function global:Get-Download([int]$index, [int]$last, [int]$first, [int]$open)
{
  $url = (Get-Feed iisdownloads)
  return (Get-RSS $url $index $last $first $open)
}

## Gets a generic RSS Feed
##---------------------------------------------------
function global:Get-RSS([string]$url, [int]$index, [int]$last, [int]$first, [int]$open)
{
  $feed = [xml](new-object System.Net.WebClient).DownloadString($url)
  if($index)
  {
    return $feed.rss.channel.item[$index]
  }
  if($open)
  {
    $ieaddr = $env:programfiles + "\internet explorer\iexplore.exe"
    return &amp;amp;(get-item $ieaddr) $feed.rss.channel.item[$open].link
  }
  if($last)
  {
    return ($feed.rss.channel.item | Select -last $last)
  }
  if($first)
  {
    return ($feed.rss.channel.item | Select -first $first)
  }
  return $feed.rss.channel.item
}
&lt;/PRE&gt;
&lt;P&gt;Once you've saved this file, close it.&amp;nbsp; We need to sign this script and execute it by typing:&lt;/P&gt;
&lt;P class=ConsoleCode&gt;PS IIS:&amp;gt; sign blogs.ps1&lt;BR&gt;PS IIS:&amp;gt; ./blogs.ps1&lt;/P&gt;
&lt;P class=ConsoleCode&gt;Now lets start reading.&amp;nbsp; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Read all Blogs&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=ConsoleCode&gt;PS iis:\&amp;gt; Get-Blog &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Read the last five blog posts&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=ConsoleCode&gt;PS iis:\&amp;gt; Get-Blog -last 5 &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Read the first five blog posts&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=ConsoleCode&gt;PS iis:\&amp;gt; Get-Blog -first 5 &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Read the 8th blog post&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=ConsoleCode&gt;PS iis:\&amp;gt; Get-Blog -index 8 &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Open the 12th blog post and open in Internet Explorer&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=ConsoleCode&gt;PS iis:\&amp;gt; Get-Blog -open 12 &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Read all blog posts by Bill Staples&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=ConsoleCode&gt;PS iis:\&amp;gt; Get-AuthorBlog bills&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Read all items in DownloadCENTER&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=ConsoleCode&gt;PS iis:\&amp;gt; Get-Download&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Get titles of all items in DownloadCENTER&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=ConsoleCode&gt;PS iis:\&amp;gt; Get-Download | Select Title&lt;/P&gt;
&lt;P&gt;Of course, all the laws of Powershell still apply, so I can still do fun stuff like like listing only the blog titles from my blog.&lt;/P&gt;
&lt;P class=ConsoleCode&gt;PS iis:\&amp;gt; Get-AuthorBlog TobinTitus | Select Title&lt;/P&gt;
&lt;P&gt;I can do the same witht he raw blog output:&lt;/P&gt;
&lt;P class=ConsoleCode&gt;PS iis:\&amp;gt; Get-Blog -last 5 | Select pubDate, Creator, Title&lt;/P&gt;
&lt;P&gt;Happy reading.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/photos/tobint/images/1671449/original.aspx"&gt;&lt;IMG title="IIS.NET Blogs in Powershell" style="WIDTH:561px;HEIGHT:279px;" height=279 alt="IIS.NET Blogs in Powershell" src="http://blogs.msdn.com/photos/tobint/images/1671449/original.aspx" width=561 align=middle border=0&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1577140" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="PowerShell" scheme="http://blogs.iis.net/tobintitus/archive/tags/PowerShell/default.aspx" /><category term="Download" scheme="http://blogs.iis.net/tobintitus/archive/tags/Download/default.aspx" /><category term="IIS.NET" scheme="http://blogs.iis.net/tobintitus/archive/tags/IIS.NET/default.aspx" /></entry><entry><title>OT: Cat and Mouse</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/02/08/ot-cat-and-mouse.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/02/08/ot-cat-and-mouse.aspx</id><published>2007-02-09T07:39:00Z</published><updated>2007-02-09T07:39:00Z</updated><content type="html">&lt;P&gt;For those of you looking for IIS information, this blog post is not for you. For those of you that just like general computer information, read on and enjoy.&lt;/P&gt;
&lt;P&gt;The computer mouse has come a long way over the years.&amp;nbsp; When &lt;A class="" href="http://en.wikipedia.org/wiki/Doug_Englebart"&gt;Doug Engelbart&lt;/A&gt; invented the computer mouse, it was rather crude looking but was none-the-less very revolutionary.&amp;nbsp; Engelbart showed his invention to the world in 1968 during a presentation now know as "&lt;A class="" href="http://sloan.stanford.edu/MouseSite/1968Demo.html"&gt;The Mother of All Demos.&lt;/A&gt;"&amp;nbsp; The mouse that Engelbart demoed was an electromechanical device that leveraged a large sphere to turn &lt;EM&gt;x&lt;/EM&gt; and &lt;EM&gt;y&lt;/EM&gt; coordinate counters as the device was rolled across a surface. Each click of the counter would tell the computer how far the mouse had "traveled".&amp;nbsp; For several years the mouse kept the same basic principal.&amp;nbsp;We improved on the original idea and replaced a large sphere with small rubbery balls with &lt;EM&gt;x&lt;/EM&gt;,&amp;nbsp;&amp;nbsp;i and often an additional diagonal gear wheel. The diagonal indicator was used to help correct the cursor movement if the mouse was rotated or tilted. The rubber helped the ball move across slick surfaces when a mouse pad just wasn't cutting it.&amp;nbsp;The downside to this rubbery surface was that pet owners ended up with a lot of cat (or dog) fur rolling into the mouse.&amp;nbsp; You would often have to open the bottom portion of the mouse and clean the hair and other debris out to make your pointing device work efficiently again.&amp;nbsp; Playing Doom or Quake with a junked-up mouse was an instant&amp;nbsp;indication of a &lt;A class="" href="http://en.wikipedia.org/wiki/N00b"&gt;n00b&lt;/A&gt; that needed serious &lt;A class="" href="http://en.wikipedia.org/wiki/Pwn"&gt;pwning&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Roll forward to the present day and we find optical mice taking the electromechanical device's place. The optical approach solves a lot of the problems associated with older mice. For one, the new mice don't have the rolling dowel-like rollers (counters) that can get gunked up anymore.&amp;nbsp; A rubbery ball is not picking up every piece of debris and yanking it into the mouse cavity as though it were a time-capsule for desktop debris.&amp;nbsp; So, why does your mouse still freak out when a piece of fur gets trapped under your optical mouse?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer is pretty interesting and I'm sure will be solved with the next iteration of mouse invention.&amp;nbsp;Many optical mice are created using a camera or an optoelectric sensor,&amp;nbsp;an optical processor to compare images taken by the camera/sensor, and an LED&amp;nbsp; that illuminates the surface under your mouse.&amp;nbsp; The camera/sensor takes ~1500 picture samples a second!&amp;nbsp; The pictures are small (usually 10-20 square pixels) and gray-scale (usually registering fewer than 100 shades).&amp;nbsp; The optical processor examines and compares the picture samples to determine the relative position of the mouse to its previous position.&lt;/P&gt;
&lt;P&gt;Now&amp;nbsp;introduce your cat's hair to the equation.&amp;nbsp; The cat hair gets entangled in the small cavity of the mouse where the optical sensor lives. As the mouse rolls across the desk, static builds up and flips the hair around wildly.&amp;nbsp;As your mouse snaps those thousands of pictures, the hair position is captured&amp;nbsp;and the optical processor gets confused by the sudden movement of the cat hair in the picture comparisons.&amp;nbsp; You can move your mouse slowly to the right, but if the hair is flipped around within the mouse cavity, the processor will think that you have jerked the mouse to the left or sharply downward.&amp;nbsp; If your cat is watching the computer screen as mine often does, these sharp movements may cause the cat to attack your monitor -- truly creating an interesting game of cat and mouse.&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1571213" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="Hardware" scheme="http://blogs.iis.net/tobintitus/archive/tags/Hardware/default.aspx" /><category term="Off topic" scheme="http://blogs.iis.net/tobintitus/archive/tags/Off+topic/default.aspx" /></entry><entry><title>Logging UI for Vista v1.1 Released</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/02/01/logging-ui-for-vista-v1-1-released.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/02/01/logging-ui-for-vista-v1-1-released.aspx</id><published>2007-02-01T20:45:00Z</published><updated>2007-02-01T20:45:00Z</updated><content type="html">&lt;P&gt;I have completed the final pieces of the Logging UI for Vista and posted them on the DownloadCENTER.&amp;nbsp; I've completed functionality to allow you to configure &lt;STRONG&gt;central binary logging&lt;/STRONG&gt;, &lt;STRONG&gt;central W3C logging&lt;/STRONG&gt;, and &lt;STRONG&gt;site defaults&lt;/STRONG&gt;.&amp;nbsp; I've modified the look and feel of some of the pages and I've even added &lt;STRONG&gt;tool tips&lt;/STRONG&gt; that show what configuration is being changed with each control.&lt;/P&gt;
&lt;P&gt;The source code for this project is also available in C#.&amp;nbsp; If I get a few more moments of time and/or many requests in the next few weeks, I may also port the source to VB.NET and C++/CLI.&lt;/P&gt;
&lt;P&gt;In the mean time, if you have any questions, feel free to contact me.&lt;/P&gt;
&lt;P&gt;You can find the download containing both the source code and the MSI here: &lt;A href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;g=6&amp;amp;i=1328"&gt;http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;g=6&amp;amp;i=1328&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; You can find screenshots of the UI module here: &lt;A href="http://blogs.msdn.com/photos/tobint/category20627.aspx"&gt;http://blogs.msdn.com/photos/tobint/category20627.aspx&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1559745" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="IIS 7" scheme="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx" /><category term="SDK" scheme="http://blogs.iis.net/tobintitus/archive/tags/SDK/default.aspx" /><category term=".NET" scheme="http://blogs.iis.net/tobintitus/archive/tags/.NET/default.aspx" /><category term="UI Module" scheme="http://blogs.iis.net/tobintitus/archive/tags/UI+Module/default.aspx" /></entry><entry><title>Logging UI for IIS 7.0 on Vista: Available for download</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/01/30/logging-ui-for-iis-7-0-on-vista.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/01/30/logging-ui-for-iis-7-0-on-vista.aspx</id><published>2007-01-30T20:25:00Z</published><updated>2007-01-30T20:25:00Z</updated><content type="html">&lt;P&gt;As many of you already know, the management console for IIS 7.0 on Windows Vista does not have a UI for logging.&amp;nbsp; Since this was a pain point for several customers, I decided to test out the extensibility APIs by creating a logging UI module.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I've posted a &lt;A class="" href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;i=1328&amp;amp;g=6"&gt;preview version&lt;/A&gt; of my logging UI on the newly opened &lt;A class="" href="http://www.iis.net/downloads/default.aspx?tabid=3"&gt;IIS Download Center&lt;/A&gt;. I will be releasing a few updates throughout the week with changes.&amp;nbsp; The module also contains the source code for my UI module under the &lt;A class="" href="http://www.microsoft.com/resources/sharedsource/licensingbasics/limitedpermissivelicense.mspx"&gt;Microsoft Permissive License&lt;/A&gt;.&amp;nbsp; This code will also be updated in future releases.&lt;/P&gt;
&lt;P&gt;You can find the download at: &lt;A href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;i=1328&amp;amp;g=6"&gt;http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;i=1328&amp;amp;g=6&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you have any questions, please feel free to &lt;A class="" href="http://blogs.iis.net/tobintitus/contact.aspx"&gt;contact me&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1556061" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="IIS 7" scheme="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx" /><category term="SDK" scheme="http://blogs.iis.net/tobintitus/archive/tags/SDK/default.aspx" /><category term=".NET" scheme="http://blogs.iis.net/tobintitus/archive/tags/.NET/default.aspx" /><category term="UI Module" scheme="http://blogs.iis.net/tobintitus/archive/tags/UI+Module/default.aspx" /><category term="Download" scheme="http://blogs.iis.net/tobintitus/archive/tags/Download/default.aspx" /></entry><entry><title>Ups and Downs of the past month</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2007/01/21/ups-and-downs-of-the-past-month.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2007/01/21/ups-and-downs-of-the-past-month.aspx</id><published>2007-01-21T21:55:00Z</published><updated>2007-01-21T21:55:00Z</updated><content type="html">&lt;P&gt;It's sometimes hard to hold a completely technical blog, particularly when you have long absences from one post to the next. You feel you have to explain yourself to your readership each time you take more than a week or two between posts.&amp;nbsp; This is no different.&amp;nbsp; Despite having a ton of stuff to blog about, I haven't posted since December.&amp;nbsp; Much of this has to do with regular holiday planning, but much more has happened.&amp;nbsp; For me, this past month has had some major ups and downs for me emotionally and I'm still a little mixed up.&lt;/P&gt;
&lt;P&gt;This post will have a great deal of personal information in it, and much of it has nothing to do with IIS, but it should give you some insight into Microsoft if you are interested in that sort of thing. &lt;/P&gt;
&lt;P&gt;If you've been paying attention to the weather in the Pacific Northwest, you know that on December 14th, we had a major windstorm that knocked out power to over 1 million customers.&amp;nbsp; The bad news is that on December 15th, I had a flight scheduled to go visit my family on the west coast.&amp;nbsp; United Airlines cancelled several flights, which put their check-in line in complete disarray.&amp;nbsp; Our flight wasn't cancelled, but no thanks to United Airlines, we were not able to board our flight, and no other flights could be found for my wife and&amp;nbsp;me along with our two cats.&amp;nbsp; Our trip was cancelled. &lt;/P&gt;
&lt;P&gt;Since I was still in town, I helped put the finishing touches on a "Think Week" paper I had been writing along with two other employees here at Microsoft.&amp;nbsp; Despite the power outages, we were able to make it into one of the buildings at Microsoft and submit our paper by the deadline. It was an interesting experience to submit a paper that every full time employee of the company can read and comment on, including Bill Gates.&lt;/P&gt;
&lt;P&gt;I also took the opportunity to work on writing a UI module for IIS in that time.&amp;nbsp; The module was actually finished, but after consulting with one of the developers, I decided to modify the sample and I haven't had time to clean it up and submit it yet.&amp;nbsp; More on that later.&lt;/P&gt;
&lt;P&gt;On December 28th, I got a phone call saying that my grandfather had passed away.&amp;nbsp; My family has always been important to me.&amp;nbsp; My grandparents hold a special place in my heart because they gave me a lot of my determination.&amp;nbsp; My grandfather was a tail-gunner in World War II, had seen more inventions and re-inventions in his lifetime than I could fathom.&amp;nbsp; He always chuckled when I came home to visit and told him about this great "new" thing in technology that would change the world unlike anything else ever had.&amp;nbsp; I didn't get the joke then, but I do now.&amp;nbsp; I don't mean to downplay the importance of technology. When putting it in perspective, we are not the first people to change the world and we will certainly not be the last.&amp;nbsp; I'll miss my grandfather terribly and there are no words to describe how this has changed my world.&lt;/P&gt;
&lt;P&gt;It was good, however, to go back home for my grandfather's funeral. I got to help my dad clean up and set up his workshop.&amp;nbsp; I also got to see one my best friend since I was 8 years old. I haven't seen him in 10 months since I moved out west to work for Microsoft.&amp;nbsp; I returned from my grandfather's funeral on the 8th and have tried to get 100% back into the swing of things.&amp;nbsp; I really hadn't been able to focus on work the way that I usually do until Thursday.&amp;nbsp; I was finally making some headway on a few projects at work.&lt;/P&gt;
&lt;P&gt;Before I continue, I need to give some of you some background on me.&amp;nbsp; 20 years ago, when I was in 5th grade, I taught myself Microsoft BASIC and Atari Assembler.&amp;nbsp; I remember telling my parents back then that I was going to work for Microsoft one day.&amp;nbsp; My mom told me to finish my homework first.&amp;nbsp; Of course, I have finished my homework and 20 years later, here I am working for Microsoft and submitting a paper to the very man that started the company. A few weeks had gone by and we received a LOT of feedback about our paper, but none of that feedback is from Mr Gates.&amp;nbsp; We sort of expected that.&amp;nbsp; Bill doesn't respond to many papers in a year.&lt;/P&gt;
&lt;P&gt;However, the other day I got a barely coherent message on my cell phone. It was from one of the co-authors of the think week paper.&amp;nbsp; He was an excited statement about Bill Gates reading our paper.&amp;nbsp; I tried to connect to the VPN to go read the feedback but had some issues because my home network was, shall we say, "in flux".&amp;nbsp; It drove me nuts that there was feedback from the very man that we addressed the paper to, but I couldn't read it.&amp;nbsp; I jumped in the shower and then rushed into work to read it personally. During the entire ride to work, I was forcing myself to watch my speed carefully. However, my heart was racing so fast that I think it pushed 10 extra pounds of blood into my right foot.&amp;nbsp; I got to work and quickly opened up the Think Week site and scrolled to our paper.&amp;nbsp; When I read the comment, I couldn't help but become giddy.&amp;nbsp; The feedback was favorable and verbose -- about a page and a half.&amp;nbsp; I was elated and sitting here today, I'm still in shock about the entire thing.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I have to say that I'm extremely thankful for the opportunities we have inside our company.&amp;nbsp; Inside the company, you can tackle any problem that you want.&amp;nbsp; You simply need to apply your efforts in an area, and you'll likely get the support of your managers, team, and friends.&amp;nbsp; I know there are many people out there who like to point out some negative issues inside Microsoft.&amp;nbsp; Some anonymous blogs out there take a rather candid look at company issues and seem to err on the side of complaining.&amp;nbsp; My experience inside the company so far has been spectacular.&amp;nbsp; It helps that I knew people inside the company before I moved out here. That said, there are many opportunities inside the company to make recommendations and get involved.&amp;nbsp; I can't be happy enough with that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;So, while this was not a technical post, I felt I owed it to you all to explain where I have been and why I haven't been blogging (again). Thanks for putting up with me.&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1541744" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="Culture" scheme="http://blogs.iis.net/tobintitus/archive/tags/Culture/default.aspx" /><category term="ThinkWeek" scheme="http://blogs.iis.net/tobintitus/archive/tags/ThinkWeek/default.aspx" /><category term="Off topic" scheme="http://blogs.iis.net/tobintitus/archive/tags/Off+topic/default.aspx" /></entry><entry><title>Extending Microsoft.Web.Administration through PowerShell  (Part II)</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2006/12/01/more-on-iis-7-administration-with-powershell.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2006/12/01/more-on-iis-7-administration-with-powershell.aspx</id><published>2006-12-01T17:03:00Z</published><updated>2006-12-01T17:03:00Z</updated><content type="html">&lt;P&gt;In my &lt;A class="" href="http://blogs.iis.net/tobintitus/archive/2006/11/30/powershell-and-microsoft-web-administration.aspx"&gt;previous post&lt;/A&gt;, I showed you how easy it was to leverage your knowledge of the IIS 7 managed SDK in Windows PowerShell.&amp;nbsp; We loaded the IIS 7 managed assemblies and then traversed the object model to display site information and stop application pools.&amp;nbsp; While this in itself was pretty cool, I don't think I quite got my point across about how powerful IIS 7 and PowerShell are together. As such, I wanted to show you some more fun things to do with PowerShell in the name of easy IIS 7 administration.&lt;/P&gt;
&lt;P&gt;First, our examples still required a great deal of typing and piping and filtering.&amp;nbsp; Let's modify our profile script from my previous post by adding at least one new global variable that will give us access to the ServerManager without much typing.&amp;nbsp; Add the following line to your profile script from my previous post.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;new-variable iismgr -value (New-Object Microsoft.Web.Administration.ServerManager) -scope "global"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;(if you don't have a profile script yet, go back to my &lt;A class="" href="http://blogs.iis.net/tobintitus/archive/2006/11/30/powershell-and-microsoft-web-administration.aspx"&gt;previous post&lt;/A&gt; to learn&amp;nbsp;how to create one).&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; If you signed your script before, you'll have to do it again after modifying the script&lt;/P&gt;
&lt;P&gt;Open a new instance of PowerShell and now you can access the site collection just by typing:&lt;/P&gt;
&lt;P&gt;PS C:\&amp;gt; &lt;STRONG&gt;$iismgr.Sites&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;That's considerably smaller than our previous examples.&amp;nbsp; But let's not stop there.&amp;nbsp; What happens if I want to search the site collection? PowerShell has some fun syntax for this as well. I simply pipe the output of my SiteCollection to a "Where-Object" cmdlet and then specify what site I'm looking for:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;$iismgr.Sites | Where-Object {$_.Name -match "^Default*"}&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is still&amp;nbsp;quite a bit of typing when all I really want to do is find the default website.&amp;nbsp;You may ask "Wouldn't it be easier if we could just add a "Find" method to the SiteCollection object?" Well I'm glad &lt;EM&gt;you&lt;/EM&gt; asked *cough*!&amp;nbsp; Next, we are going to do just that! Open up another instance of notepad and add the following XML to it:&lt;/P&gt;
&lt;DIV style="FONT-FAMILY:Courier;"&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;BR&gt;&amp;lt;!-- *******************************************************************&lt;BR&gt;Copyright (c) Microsoft Corporation.&amp;nbsp; All rights reserved.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;THIS SAMPLE CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY &lt;BR&gt;OF ANY KIND,WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO &lt;BR&gt;THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR&lt;BR&gt;PURPOSE. IF THIS CODE AND INFORMATION IS MODIFIED, THE ENTIRE RISK OF USE&lt;BR&gt;OR RESULTS IN CONNECTION WITH THE USE OF THIS CODE AND INFORMATION &lt;BR&gt;REMAINS WITH THE USER.&lt;BR&gt;******************************************************************** --&amp;gt; 
&lt;P&gt;&amp;lt;Types&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Type&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name&amp;gt;Microsoft.Web.Administration.SiteCollection&amp;lt;/Name&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;lt;Members&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ScriptMethod&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name&amp;gt;Find&amp;lt;/Name&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Script&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rtr = "";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if ( $args[0] ) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;$name = $args[0];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rtr = ((New-Object Microsoft.Web.Administration.ServerManager).Sites | Where-Object {$_.Name -match $name}) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rtr = "No sites found." &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rtr&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Script&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ScriptMethod&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Members&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/Type&amp;gt;&lt;BR&gt;&amp;lt;/Types&amp;gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;What we've done is identified that we want to add a scripted method to the Microsoft.Web.Administration.SiteCollection object. In our case,&amp;nbsp;I've added a "Find" method&amp;nbsp;by&amp;nbsp;using the same cmdlet that we typed before to search the site collection. The&amp;nbsp;difference is, this type I use the $args array variable to check for a parameter and use it if one is available.&amp;nbsp; Now, save this file into your %windir%\system32\WindowsPowerShell\v1.0\ directory as "iis.types.ps1xml".&amp;nbsp; Once you've saved the file, sign it the same way you signed your profile script.&amp;nbsp; Keep in mind that these xml files contain code, so signing your xml is required to keep your PowerShell experience a secure one.&amp;nbsp; Now, open your profile script (again) and add the following lines to the end:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;new-variable iissites -value (New-Object Microsoft.Web.Administration.ServerManager).Sites -scope "global"&lt;BR&gt;new-variable iisapppools -value (New-Object Microsoft.Web.Administration.ServerManager).ApplicationPools -scope "global"&lt;BR&gt;update-typedata -append (join-path -path $PSHome -childPath "iis.types.ps1xml")&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note: &lt;/STRONG&gt;Once again, you'll have to re-sign this profile if your execution policy requires signed scripts.&lt;/P&gt;
&lt;P&gt;Notice that I added two more variables: $iissites and $iisapppools. These variables allow me to access the site collection and application pool collection with a simple keyword.&amp;nbsp; Lets try them out in PowerShell. Make sure you open a new instance of PowerShell so your profile script and xml type data are updated properly. Once your new instance of PowerShell is open, type the following:&lt;/P&gt;
&lt;P&gt;PS C:\&amp;gt; &lt;STRONG&gt;$iissites.Find("^Default*")&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;PowerShell will do all the work for you and you have MUCH less typing to do.&lt;/P&gt;
&lt;P&gt;Another alternative to using xml files is to simply create a function and add it to your profile. For instance, we can create a function called "findsite" that provides the same functionality as our previous example. Either type the following command into PowerShell or add it to your profile script:&lt;/P&gt;
&lt;P&gt;PS C:\&amp;gt; &lt;STRONG&gt;function findsite { $name=$args[0]; ((New-Object Microsoft.Web.Administration.ServerManager).Sites | Where-Object {$_.Name -match $name});&lt;/STRONG&gt; &lt;STRONG&gt;} }&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Now you can search for a site using the following syntax:&lt;/P&gt;
&lt;P&gt;PS C:\&amp;gt; &lt;STRONG&gt;findsite default*&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Whatever way we choose to extend Microsoft.Web.Administration and/or PowerShell, we can use our output as we did before:&lt;/P&gt;
&lt;P&gt;PS C:\&amp;gt; &lt;STRONG&gt;(findsite default*).Id&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The previous line should display the Id of the default web site.&amp;nbsp; We can also stop the website:&lt;/P&gt;
&lt;P&gt;PS C:\&amp;gt; &lt;STRONG&gt;(findsite default*).Stop()&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;We can keep taking this to extremes and truncate every operation that we perform on a semi-regular basis.&amp;nbsp; These scripts are not one-offs. Each script function we create or append to an existing object model can be reused and piped as input to another function.&amp;nbsp; The possibilities are endless and completely customizable to your needs.&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1483181" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="IIS 7" scheme="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx" /><category term="PowerShell" scheme="http://blogs.iis.net/tobintitus/archive/tags/PowerShell/default.aspx" /></entry><entry><title>Accessing Microsoft.Web.Administration through PowerShell (Part I)</title><link rel="alternate" type="text/html" href="http://blogs.iis.net/tobintitus/archive/2006/11/30/powershell-and-microsoft-web-administration.aspx" /><id>http://blogs.iis.net/tobintitus/archive/2006/11/30/powershell-and-microsoft-web-administration.aspx</id><published>2006-12-01T04:09:00Z</published><updated>2006-12-01T04:09:00Z</updated><content type="html">&lt;P&gt;I've caught the PowerShell bug. In between stints with my ever-expanding code samples, I play with PowerShell a lot.&amp;nbsp; I thought I'd share a quick example of how to load Microsoft.Web.Administration.dll and use it to perform some basic tasks.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note: &lt;/STRONG&gt;I'm running these samples on Windows Vista RTM, but I have no reason to believe this will not work on the PowerShell release candidates for the Vista RC* builds that are &lt;A class="" title="available now" href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx"&gt;available now&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;So let's get started.&lt;/P&gt;
&lt;P&gt;First, PowerShell has no idea where Microsoft.Web.Administration.DLL is so you have to tell it how to load it. Anyone who has written code to&amp;nbsp;dynamically load an assembly should be familiar with this syntax.&amp;nbsp; Type the following command&lt;/P&gt;
&lt;P&gt;PS C:\&amp;gt; &lt;STRONG&gt;[System.Reflection.Assembly]::LoadFrom( "C:\windows\system32\inetsrv\Microsoft.Web.Administration.dll" )&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The path to your assembly may change depending on your install.&amp;nbsp; I'll show you later how to use environment variables to calculate the correct path.&amp;nbsp; In the mean time the out put of the line above display something like the following:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV style="FONT-FAMILY:COURIER;"&gt;GAC&amp;nbsp;&amp;nbsp;Version&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Location &lt;/DIV&gt;
&lt;DIV style="FONT-FAMILY:COURIER;"&gt;---&amp;nbsp;&amp;nbsp;-------&amp;nbsp;&amp;nbsp;&amp;nbsp; -------- &lt;/DIV&gt;
&lt;DIV style="FONT-FAMILY:COURIER;"&gt;True v2.0.50727 C:\Windows\assembly\GAC_MSIL\Microsoft.Web.Administration\7.0.0.0__31bf3856ad364e35\Microsoft.... &lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Once the assembly is loaded you can use PowerShell's "New-Object" command to create a ServerManager object that is defined in Microsoft.Web.Administration.&lt;/P&gt;
&lt;P&gt;PS C:\&amp;gt; &lt;STRONG&gt;(New-Object Microsoft.Web.Administration.ServerManager)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This doesn't give you much except the list of properties the ServerManager exposes:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV style="FONT-FAMILY:COURIER;"&gt;ApplicationDefaults&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Microsoft.Web.Administration.ApplicationDefaults&lt;BR&gt;ApplicationPoolDefaults&amp;nbsp; :&lt;BR&gt;ApplicationPools&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&lt;BR&gt;SiteDefaults&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Microsoft.Web.Administration.SiteDefaults&lt;BR&gt;Sites&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {Default Web Site}&lt;BR&gt;VirtualDirectoryDefaults : Microsoft.Web.Administration.VirtualDirectoryDefaults&lt;BR&gt;WorkerProcesses&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {} &lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To get more detail, you need to use the properties and methods of the ServerManager object to drill down and get the information we want. The ServerManager provides access to all of the sites on your machine through a SiteCollection object. This SiteCollection is made available through the "Sites" property of the ServerManager.&amp;nbsp; 
&lt;P&gt;PS C:\&amp;gt; &lt;STRONG&gt;(New-Object Microsoft.Web.Administration.ServerManager).Sites&lt;/STRONG&gt; 
&lt;P&gt;Which will produce&amp;nbsp;a list view of all the sites and their associated property names/values. &lt;BR&gt;&lt;BR&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV style="FONT-FAMILY:COURIER;"&gt;ApplicationDefaults&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Microsoft.Web.Administration.ApplicationDefaults&lt;BR&gt;Applications&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {DefaultAppPool, Classic .NET AppPool}&lt;BR&gt;Bindings&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {}&lt;BR&gt;Id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 1&lt;BR&gt;Limits&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Microsoft.Web.Administration.SiteLimits&lt;BR&gt;LogFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Microsoft.Web.Administration.SiteLogFile&lt;BR&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Default Web Site&lt;BR&gt;ServerAutoStart&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : True&lt;BR&gt;State&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Started&lt;BR&gt;TraceFailedRequestsLogging : Microsoft.Web.Administration.SiteTraceFailedRequestsLogging&lt;BR&gt;VirtualDirectoryDefaults&amp;nbsp;&amp;nbsp; : Microsoft.Web.Administration.VirtualDirectoryDefaults&lt;BR&gt;ElementTagName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : site&lt;BR&gt;IsLocallyStored&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : True&lt;BR&gt;RawAttributes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {name, id, serverAutoStart} &lt;/DIV&gt;
&lt;P style="FONT-FAMILY:COURIER;"&gt;ApplicationDefaults&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Microsoft.Web.Administration.ApplicationDefaults&lt;BR&gt;Applications&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {DefaultAppPool}&lt;BR&gt;Bindings&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {}&lt;BR&gt;Id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 2&lt;BR&gt;Limits&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Microsoft.Web.Administration.SiteLimits&lt;BR&gt;LogFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Microsoft.Web.Administration.SiteLogFile&lt;BR&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Test Web Site 1&lt;BR&gt;ServerAutoStart&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : False&lt;BR&gt;State&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Stopped&lt;BR&gt;TraceFailedRequestsLogging : Microsoft.Web.Administration.SiteTraceFailedRequestsLogging&lt;BR&gt;VirtualDirectoryDefaults&amp;nbsp;&amp;nbsp; : Microsoft.Web.Administration.VirtualDirectoryDefaults&lt;BR&gt;ElementTagName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : site&lt;BR&gt;IsLocallyStored&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : True&lt;BR&gt;RawAttributes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {name, id, serverAutoStart} &lt;BR&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Of course, this isn't the easiest view to read, so let's say we just list the site names by piping our site list to&amp;nbsp;the "ForEach-Object" command in PowerShell and display a list of site names only:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;PS C:\&amp;gt; &lt;STRONG&gt;(New-Object Microsoft.Web.Administration.ServerManager).Sites | ForEach-Object {$_.Name}&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This looks much more concise:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV style="FONT-FAMILY:COURIER;"&gt;Default Web Site&lt;BR&gt;Test Web Site 1 &lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We could also use the Select-Object syntax to query the list into a table format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;PS C:\&amp;gt; &lt;STRONG&gt;(New-Object Microsoft.Web.Administration.ServerManager).Sites | Select Id, Name&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV style="FONT-FAMILY:COURIER;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Id Name&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -- ----&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 Default Web Site&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 Test Web Site 1&lt;/DIV&gt;
&lt;P&gt;Now lets use PowerShell to manage application pools. We can fit several commands on one line by using the semi-colon.&amp;nbsp; The following command-line is actually four different operations: Storing the application pool collection into a variable, displaying the name and runtime status of the first application pool, stopping the first application pool, then displaying the name and status again.&lt;/P&gt;
&lt;P&gt;PS C:\&amp;gt; &lt;STRONG&gt;$pools=(New-Object Microsoft.Web.Administration.ServerManager).ApplicationPools; $pools.Item(0) | Select Name, State;$pools.Item(0).Stop(); $pools.Item(0) | Select Name, State&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Running this sample should display the following:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV style="FONT-FAMILY:COURIER;"&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; State&lt;BR&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -----&lt;BR&gt;DefaultAppPool&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Started&lt;BR&gt;Stopped&lt;BR&gt;DefaultAppPool&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stopped&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is nice, but we can do this already with appcmd.exe right? Well, to some extent.&amp;nbsp; We don't get the features of PowerShell that allow us to format our output the data to our liking. Also, as a developer, I find it much easier to use the API syntax I'm already familiar with than to remember appcmd.exe syntax.&amp;nbsp; Furthermore, PowerShell allows us to use WMI alongside our managed code calls, and unlike appcmd.exe, you can extend PowerShell and cmdlets.&amp;nbsp;PowerShell gives you the ability to easily manage multiple servers from one command prompt on one machine.&amp;nbsp; Watch the PowerShell/IIS 7 interview on &lt;A class="" title=Channel9 href="http://channel9.msdn.com/Showpost.aspx?postid=256994"&gt;Channel9&lt;/A&gt; if you want to see this remote administration in action.&lt;/P&gt;
&lt;P&gt;One last thing that PowerShell brings to the table is the ability to "spot-weld" our object models (as &lt;SPAN&gt;&lt;A class="" title="Scott Hanselman" href="http://www.hanselman.com/blog/CategoryView.aspx?category=PowerShell"&gt;&lt;STRONG&gt;Scott&lt;/STRONG&gt; Hanselman&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp;quipped). You can create/modify/extend type data and formatting to your hearts desire.&amp;nbsp; For more information on this, check out the PowerShell documentation found in the PowerShell install, or in the &lt;A class="" title="PowerShell documentation set" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=B4720B00-9A66-430F-BD56-EC48BFCA154F&amp;amp;displaylang=en"&gt;PowerShell documentation set&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;So, I would be remiss in this post if I didn't try to make your PowerShell / IIS 7.0 life easier.&amp;nbsp; As such, I've created a profile script that loads all the IIS 7.0 managed assemblies for you.&amp;nbsp; The script is simple and contains more&amp;nbsp; echo commands than actual working script lines.&lt;/P&gt;
&lt;P&gt;To install this script run the following command inside PowerShell:&lt;/P&gt;
&lt;DIV style="FONT-FAMILY:Courier;"&gt;PS C:&amp;gt; &lt;STRONG&gt;if ( test-path $profile ) { echo "Path exists." } else { new-item -path $profile -itemtype file -force }; notepad $profile&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;P&gt;This will create a profile path for you if you don't already have one, then open up your profile in notepad.&amp;nbsp; If you haven't added anything to the file, it will obviously display an empty file.&amp;nbsp; Paste the following in notepad when it opens:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV style="FONT-FAMILY:Courier;"&gt;echo "Microsoft IIS 7.0 Environment Loader"&lt;BR&gt;echo "Copyright (C) 2006 Microsoft Corporation. All rights reserved."&lt;BR&gt;echo "&amp;nbsp; Loading IIS 7.0 Managed Assemblies"&lt;BR&gt;&lt;BR&gt;$inetsrvDir = (join-path -path $env:windir -childPath "\system32\inetsrv\")&lt;BR&gt;Get-ChildItem -Path (join-path -path $inetsrvDir -childPath "Microsoft*.dll") | ForEach-Object {[System.Reflection.Assembly]::LoadFrom( (join-path -path $inetsrvDir -childPath $_.Name)) }&lt;BR&gt;&lt;BR&gt;echo "&amp;nbsp; Assemblies loaded."&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Now, save the profile and close notepad.&amp;nbsp; You will likely have to sign this script &lt;EM&gt;or&lt;/EM&gt; change your script execution policy to something very weak&amp;nbsp;to make this script run properly (obviously I'm not recommending the latter).&amp;nbsp;To find out more about signing scripts, type "get-help about_signing" in PowerShell.&amp;nbsp;The instructions to create a self-signed certificate found in that help file are as follows:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV style="FONT-FAMILY:Courier;"&gt;In an SDK Command Prompt window, run the following commands.&lt;BR&gt;The first command creates a local certificate authority for your computer.&lt;BR&gt;The second command generates a personal certificate from the certificate authority:&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;makecert -n "CN=PowerShell Local Certificate Root" -a sha1 `&lt;BR&gt;&amp;nbsp;&amp;nbsp; -eku 1.3.6.1.5.5.7.3.3 -r -sv root.pvk root.cer `&lt;BR&gt;&amp;nbsp;&amp;nbsp; -ss Root -sr localMachine&lt;BR&gt;makecert -pe -n "CN=PowerShell User" -ss MY -a sha1 `&lt;BR&gt;&amp;nbsp;&amp;nbsp; -eku 1.3.6.1.5.5.7.3.3 -iv root.pvk -ic root.cer&lt;BR&gt;&amp;nbsp;&amp;nbsp; MakeCert will prompt you for a private key password.&lt;/STRONG&gt; &lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Go ahead and make a certificate for yourself following those instructions. To sign your profile, within PowerShell type the following:&lt;/P&gt;
&lt;DIV style="FONT-FAMILY:Courier;"&gt;PS C:\&amp;gt;&lt;STRONG&gt;Set-AuthenticodeSignature $profile @(get-childitem cert:\CurrentUser\My -codesigning)[0] &lt;/STRONG&gt;&lt;/DIV&gt;
&lt;P&gt;So far, you've created a certificate and signed your script. Now, you will have to change your&amp;nbsp;script&amp;nbsp;execution policy&amp;nbsp;down at least one level from the default.&amp;nbsp; The default doesn't allow scripts at all.&amp;nbsp; To get scripts to execute, at the minimum you'll have to set it to "AllSigned" to allow only signed scripts to execute.&amp;nbsp; In this mode, each time you execute a script from a new publisher, you'll be asked what level of trust to assign to the&amp;nbsp;publisher (unless you respond to the prompt to "Always Run" or "Never Run" scripts from that publisher)&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV style="FONT-FAMILY:Courier;"&gt;Do you want to run software from this untrusted publisher?&lt;BR&gt;File C:\Users\TobinT\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 is published by CN=PowerShell User&lt;BR&gt;and is not trusted on your system. Only run scripts from trusted publishers.&lt;BR&gt;[V] Never run&amp;nbsp; [D] Do not run&amp;nbsp; [R] Run once&amp;nbsp; [A] Always run&amp;nbsp; [?] Help (default is "D"): &lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Now, each new instance of PowerShell that you run will automatically load the IIS 7.0 managed assemblies.&amp;nbsp; I know it seems like a great deal of work, but it really isn't once you've made a few rounds around inside PowerShell. Consider that you only have to create the script once and then you have full the full range of the managed IIS 7.0 SDK at your fingertips inside PowerShell.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;If you have problems, feel free to leave comments and I'll do my best to help you.&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1482586" width="1" height="1"&gt;</content><author><name>TobinTitus</name><uri>http://blogs.iis.net/members/TobinTitus.aspx</uri></author><category term="IIS 7" scheme="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx" /><category term="PowerShell" scheme="http://blogs.iis.net/tobintitus/archive/tags/PowerShell/default.aspx" /><category term="SDK" scheme="http://blogs.iis.net/tobintitus/archive/tags/SDK/default.aspx" /></entry></feed>