iis

Browse by Tags

All Tags » PowerShell (RSS)
MSDeploy Powershell Scripts Part II – Exceptions And Remote Server Syncs
In this blog I will show how to script syncing remote servers and add some useful exception handling. This blog assumes you have read or are familiar with part I at: http://blogs.iis.net/jamescoo/archive/2009/09/09/cool-msdeploy-powershell-scripts.aspx First a borrowed function that will help implement a try catch block in the script-let logic from part I. This will allow for MSDeploy exceptions to be caught and reported making life a bit easier when you get an error. The code is from: http://weblogs.asp.net/adweigert/archive/2007/10/10/powershell-try-catch-finally-comes-to-life.aspx Simply paste this into the Powershell session ( or start all these functions in your profile ) and you are ready to use try catch blocks: function Try { param ( [ScriptBlock]$Command = $( throw "The parameter -Command is required." ), [ScriptBlock]$Catch = { throw $_ }, [ScriptBlock]$Finally = {} ) & { $local:ErrorActionPreference = "SilentlyContinue" trap { trap { & { trap { throw...
Web Deployment Tool and PowerShell Blog
If you want to use the Web Deployment Tool with PowerShell, look no further than our own tester James Cook's PowerShell blog post . He shows how to invoke our deployment APIs through PowerShell to perform a local sync of content. In future posts, he plans to add remoting and other capabilities. And let us know if you want to use Web Deploy with PowerShell, we're interested in hearing about what tasks you'd like to accomplish and why! Read More...
Troubleshooting: IIS Powershell Module on Windows 7 RC
First thing that you need to know in regard to the IIS PowerShell Snap-in or the module when using it with Windows 7 is that you do not need to download & install the snap-in. In Windows 7 the snap-in is part of the default install of IIS. Moving on, if you want to use the snap-in with PowerShell in Windows 7 RC then you would need to import the module. Now that sounds simple. However, there is a problem. When you try to import the IIS module which is named WebAdministration you are most likely...( read more ) Read More...
R2: How Would You Manage Without It?
As many of you know, Windows Server 2008 R2 Release Candidate (RC) is made available today to MSDN and TechNet subscribers, with broader availability from Microsoft.com on May 5th. As our final broad test milestone before RTM, this really is the best chance for you to download Windows Server 2008 R2 and put it through its paces while we continue our march to RTM. This week, I’m in the UK, meeting with enterprise customers to share our product roadmap and to discuss the investments we’ve made in R2...( read more ) Read More...
Setup IIS on Server Core – Windows Server 2008 R2
With the addition of .NET Framework to Server Core in Windows Server 2008 R2 the Server Core installation option became even more appealing for those who want to use a very low footprint server for hosting their applications. Availability of .NET framework provides the following great benefits: ASP.NET support – you can now use Server Core to host your ASP.NET applications. IIS Remote Management – Server Core does not provide any user interface other than command line. But if you prefer to use IIS...( read more ) Read More...
Microsoft.com Now Running Windows Server 2008 R2 Beta
Do you remember the tale of the Windows Server 2008 “Lone Server” ? Maybe it was read to you as a bedtime story as a change from “Mommy, Why Is There a Server in the House?” There he was, this poor Windows Server 2003 server, all alone in a server farm of Windows Server 2008 machines. Out-of-date. Out-of-style. Out-of-touch with the needs of modern Web server administrators. Well let’s hope the Windows Server 2008 computers didn’t laugh too heartily at his fate, because they’re about to suffer the...( read more ) Read More...
Powershell 1.0 script to update Active Directory FTP User isolation attributes (msIIS-FTPDir, msIIS-FTPRoot)
I recently posted an article how to setup FTP User Isolation and Active Directory together. Here is the article . In the post, I mentioned you'll need to engage your AD administrator to update the two attributes. Here is a script using Powershell 1.0 Read More......( read more ) Read More...
Simple way of extending PowerShell objects with custom methods
As you may know, IIS configuration is extensible. You could add new section, extend existing one by adding new schema file into folder containing schemas. All this was described in full details in the article of Tobin Titus. When we provide methods on configuration elements with COM extension, the only way to call it using configuration APIs is through creation of method instance, then creation of input parameters element on this instance, etc -- quite convoluted way. In PowerShell we expose it in more convenient way, like intrinsic methods on the object. User is able to call these methods exactly the same way as any other intrinsic methods of given object. Let's see how runtime methods work on site element: >$site = get-webconfiguration '/system.applicationHost/sites/site[@name="mysite"]' >$site.Stop() >$site.State Stopped >$site.Start() >$site.State Started Methods that are coming from configuration extension could be called directly. Properties from...
How to change output format in PowerShell
I was looking around the Net today and stumbled on the post in Scott Hanselman's blog , where he talks about technical and marketing aspects of product naming in Microsoft. There he shows display format for IIS application pools that may be relevant to servers, where admins keep multiple versions of CLR and run applications in various modes. This output includes managed runtime version for the pool and mode (integrated or classical) for the pool. By default IIS provider shows only name, state and list of applications, assigned to this pool. It is pretty easy to change this output to what Scott prefers. Open file iisprovider.format.ps1xml (name could be changed in next release) and find view, defined there for application pool. This will be piece of XML tagged by type name "Microsoft.IIs.PowerShell.Provider.NavigationNode#AppPool". This typename means that as soon as PowerShell will find object in the output stream, which has this type name in its typenames collection, it will...
IIS Powershell User guide - Comparing representative IIS UI tasks
1. [File System] Open Explorer window for Default Web Site's home directory $path = $(get-item 'iis:\sites\default web site').physicalPath $path = [system.environment]::ExpandEnvironmentVariables($path) explorer $path Related UI Task: "Explorer" 2. [File System] Open Explorer window for Default Web Site's home directory using "DirectoryName" property $path = $(get-item 'iis:\sites\default web site\iisstart.htm').directoryName explorer $path Related UI Task: "Explorer" 3. [File System] Create File and set file content programmatically $file = new-item demo.htm -type file set-content $file.FullName "Hey, dude!" Related UI Task: "Explorer" 4. [File System] Set "Deny" for administrator user account for 'iisstart.htm' file and grant access permission for NTAccount $file = $(get-item "iis:\sites\Default Web Site\iisstart.htm ") $dacl = $file.GetAccessControl() $newRule = New-Object Security.AccessControl...
Posted: Jul 30 2008, 08:59 PM by IIS.net
Filed under:
More Posts Next page »