<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>Tobin Titus Blog : SDK</title><link>http://blogs.iis.net/tobintitus/archive/tags/SDK/default.aspx</link><description>Tags: SDK</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>IIS logging UI module sample added to CodePlex</title><link>http://blogs.iis.net/tobintitus/archive/2008/10/03/iis-logging-ui-module-sample-added-to-codeplex.aspx</link><pubDate>Fri, 03 Oct 2008 19:21:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2662091</guid><dc:creator>TobinTitus</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/tobintitus/rsscomments.aspx?PostID=2662091</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/tobintitus/commentapi.aspx?PostID=2662091</wfw:comment><comments>http://blogs.iis.net/tobintitus/archive/2008/10/03/iis-logging-ui-module-sample-added-to-codeplex.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;For those of you that remember that far back, I released a sample that also filled a need for Windows Vista. Since the original version of Windows Vista did not ship with a user interface for managing logging, and&amp;nbsp;we needed samples of how to build UI modules available to the public, I released the Logging UI module. For some time, I've been hosting that downloadable release on my private web site (&lt;A href="http://tobint.com/" mce_href="http://tobint.com"&gt;tobint.com&lt;/A&gt;). As I plan to make some major changes to my personal site over the next few months, I wanted to make sure the release was still reliably available. That said, I've now added the source code to &lt;A href="http://codeplex.com/" mce_href="http://codeplex.com"&gt;CodePlex&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;You may find the project at &lt;A href="http://www.codeplex.com/iis70loggingui"&gt;http://www.codeplex.com/iis70loggingui&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;I have worked with our source asset management team and made this available under the &amp;lt;a href="http://www.codeplex.com/iis70loggingui/license"&amp;gt;MS-PL&amp;lt;/a&amp;gt;. I hope that this makes the download reliably available. I'm looking forward to developing more samples that&amp;nbsp;I will also be releasing in the same manner. &lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2662091" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx">IIS 7</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/SDK/default.aspx">SDK</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/UI+Module/default.aspx">UI Module</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/extensibility/default.aspx">extensibility</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/vista/default.aspx">vista</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/iis+7.0/default.aspx">iis 7.0</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/Logging/default.aspx">Logging</category></item><item><title>Logging UI for Vista v1.1 Released</title><link>http://blogs.iis.net/tobintitus/archive/2007/02/01/logging-ui-for-vista-v1-1-released.aspx</link><pubDate>Thu, 01 Feb 2007 20:45:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1559745</guid><dc:creator>TobinTitus</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/tobintitus/rsscomments.aspx?PostID=1559745</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/tobintitus/commentapi.aspx?PostID=1559745</wfw:comment><comments>http://blogs.iis.net/tobintitus/archive/2007/02/01/logging-ui-for-vista-v1-1-released.aspx#comments</comments><description>&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;</description><category domain="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx">IIS 7</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/SDK/default.aspx">SDK</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/UI+Module/default.aspx">UI Module</category></item><item><title>Logging UI for IIS 7.0 on Vista: Available for download</title><link>http://blogs.iis.net/tobintitus/archive/2007/01/30/logging-ui-for-iis-7-0-on-vista.aspx</link><pubDate>Tue, 30 Jan 2007 20:25:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1556061</guid><dc:creator>TobinTitus</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/tobintitus/rsscomments.aspx?PostID=1556061</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/tobintitus/commentapi.aspx?PostID=1556061</wfw:comment><comments>http://blogs.iis.net/tobintitus/archive/2007/01/30/logging-ui-for-iis-7-0-on-vista.aspx#comments</comments><description>&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;</description><category domain="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx">IIS 7</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/SDK/default.aspx">SDK</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/UI+Module/default.aspx">UI Module</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/Download/default.aspx">Download</category></item><item><title>Accessing Microsoft.Web.Administration through PowerShell (Part I)</title><link>http://blogs.iis.net/tobintitus/archive/2006/11/30/powershell-and-microsoft-web-administration.aspx</link><pubDate>Fri, 01 Dec 2006 04:09:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1482586</guid><dc:creator>TobinTitus</dc:creator><slash:comments>12</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/tobintitus/rsscomments.aspx?PostID=1482586</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/tobintitus/commentapi.aspx?PostID=1482586</wfw:comment><comments>http://blogs.iis.net/tobintitus/archive/2006/11/30/powershell-and-microsoft-web-administration.aspx#comments</comments><description>&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;</description><category domain="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx">IIS 7</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/PowerShell/default.aspx">PowerShell</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/SDK/default.aspx">SDK</category></item><item><title>SDK Sample: Changing the runtime version of an application pool in IIS 7</title><link>http://blogs.iis.net/tobintitus/archive/2006/06/28/sdk-sample-changing-the-runtime-version-of-an-application-pool-in-iis-7.aspx</link><pubDate>Thu, 29 Jun 2006 03:03:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1327861</guid><dc:creator>TobinTitus</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/tobintitus/rsscomments.aspx?PostID=1327861</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/tobintitus/commentapi.aspx?PostID=1327861</wfw:comment><comments>http://blogs.iis.net/tobintitus/archive/2006/06/28/sdk-sample-changing-the-runtime-version-of-an-application-pool-in-iis-7.aspx#comments</comments><description>&lt;P&gt;The following quick SDK sample demonstrates how to list and change the managed runtime version of application pools programatically in IIS 7. &lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;STRONG&gt;[VB]&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;Imports System
Imports Microsoft.Web.Administration

Public Class AppPoolSample
    Shared manager As ServerManager = New ServerManager()

    ' Main application processing
    Public Shared Sub Main(ByVal args As String())
        ' Get the apppool to change
        Dim iPool As Integer = GetAppPool()

        ' Get the framework version desired
        Dim rtVersion As String = GetVersion()

        ' Set the apppool runtime
        Dim poolToSet As ApplicationPool = manager.ApplicationPools(iPool)

        Console.WriteLine("Setting application pool '{0}' to runtime version: {1}...", _
            poolToSet.Name, rtVersion)
        poolToSet.ManagedRuntimeVersion = rtVersion

        ' Commit the changes and recycle the application pool
        manager.CommitChanges()
        poolToSet.Recycle()

        Console.WriteLine("Your changes have been committed.")
    End Sub

    ' Prompts the user to select an application pool
    Public Shared Function GetAppPool() As Integer

        Dim pool As String = String.Empty
        Dim iPool As Integer = 0

        While (Not Integer.TryParse(pool, iPool))
            Console.WriteLine("Available ApplicationPools: Managed runtime version")
            Dim i As Integer
            For i = 0 To manager.ApplicationPools.Count - 1 Step i + 1
                Dim appPool As ApplicationPool = manager.ApplicationPools(i)
                Console.WriteLine("{3}{0,3}.{3}{1}: {2}", i + 1, _
                    appPool.Name, appPool.ManagedRuntimeVersion, vbTab)
            Next
            Console.Write("{0}Choose an application pool to change: ", vbCrLf)
            pool = Console.ReadLine()
        End While
        Return iPool - 1
    End Function

    ' Prompts a user to select the version of runtime they would like
    ' the application pool to use
    Public Shared Function GetVersion() As String
        Dim rtVersion As String = String.Empty
        Dim iVersion As Integer = 0

        While (Not Integer.TryParse(rtVersion, iVersion))
            Console.WriteLine("{0}  1.{0}Framework version 1.0", vbTab)
            Console.WriteLine("{0}  2.{0}Framework version 1.1", vbTab)
            Console.WriteLine("{0}  3.{0}Framework version 2.0", vbTab)
            Console.Write("Choose the new managed runtime version: ")
            rtVersion = Console.ReadLine()
        End While

        Select Case iVersion
            Case 1
                rtVersion = "v1.0"
            Case 2
                rtVersion = "v1.1"
            Case 3
                rtVersion = "v2.0"
        End Select

        Return rtVersion
    End Function
End Class
&lt;/PRE&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;STRONG&gt;[C#&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;using System;
using Microsoft.Web.Administration;

public class AppPoolSample 
{
    static ServerManager manager = new ServerManager();
    
    // Main application processing
    public static void Main(string[] args)  
    {
        // Get the apppool to change
        int iPool = GetAppPool();

        // Get the framework version desired
        string rtVersion = GetVersion();

        // Set the apppool runtime
        ApplicationPool poolToSet = manager.ApplicationPools[iPool];

        Console.WriteLine("Setting application pool '{0}' to runtime version: {1}...",
            poolToSet.Name, rtVersion);
        poolToSet.ManagedRuntimeVersion = rtVersion;

        // Commit the changes and recycle the application pool
        manager.CommitChanges();
        poolToSet.Recycle();

        Console.WriteLine("Your changes have been committed.");
    }

    // Prompts the user to select an application pool
    public static int GetAppPool()
    {
        string pool = String.Empty;
        int iPool = 0;

        while ((!int.TryParse(pool, out iPool)) ||
                (iPool &amp;gt; manager.ApplicationPools.Count || iPool &amp;lt;= 0))
        {
            Console.WriteLine("Available ApplicationPools: Managed runtime version");
            for (int i = 0; i &amp;lt;= manager.ApplicationPools.Count - 1; i++)
            {
                ApplicationPool appPool = manager.ApplicationPools[i];
                Console.WriteLine("\t{0,3}.\t{1}: {2}", i + 1, 
                    appPool.Name, appPool.ManagedRuntimeVersion);
            }
            Console.Write("\r\nChoose an application pool to change: ");
            pool = Console.ReadLine();
        }
        return iPool -1;
    }

    // Prompts a user to select the version of runtime they would like
    // the application pool to use
    public static string GetVersion()
    {
        string rtVersion = String.Empty;
        int iVersion = 0;

        while ((!int.TryParse(rtVersion, out iVersion)) ||
                (iVersion &amp;gt; 3 || iVersion &amp;lt; 1))
        {
            Console.WriteLine("\r\n\t   1.\tFramework version 1.0");
            Console.WriteLine("\t   2.\tFramework version 1.1");
            Console.WriteLine("\t   3.\tFramework version 2.0");
            Console.Write("Choose the new managed runtime version: ");
            rtVersion = Console.ReadLine();
        }

        switch (iVersion)
        {
            case 1:
                rtVersion  = "v1.0";
                break;
            case 2:
                rtVersion = "v1.1";
                break;
            case 3:
                rtVersion = "v2.0";
                break;
        }

        return rtVersion;
    }
}
&lt;/PRE&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1327861" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/tobintitus/archive/tags/IIS+7/default.aspx">IIS 7</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/SDK/default.aspx">SDK</category><category domain="http://blogs.iis.net/tobintitus/archive/tags/Application+Pools/default.aspx">Application Pools</category></item></channel></rss>