How to programmatically determine if a user is authorized in an IIS Website

A customer had a unique need of verifying authorized users against a website that runs on IIS. The code is short and simple if you know what component and method(s) to invoke.   using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Web.Management.Server; namespace ConsoleApp1 {     class Program     {         static…

2

Powershell ISE crashes on exit while using Microsoft.Web.Management.dll

I was helping a customer other day on a stubborn crash whenever Powershell-ISE and Microsoft.Web.Management.dll are put together. While calling Microsoft.Web.Management.dll from Powershell-ISE or WMIprvse.exe, upon exit, it was throwing Runtime.InteropServices.InvalidComObject error while crashing the Powershell-ISE or WMIprvse.exe. Loading/calling the same DLL on the same machine from a C# console application did NOT exhibit this…

0

IIS Services: HTTP.sys, W3SVC, WAS, W3WP, oh my!

When client makes an HTTP request to IIS, there are many layers of drivers and services it travels through. In this blog, I wanted to give a high level overview of the major layers showing how they fit altogether. Here is the high level flow: HTTP.sys is the Kernel-mode HTTP/HTTPS protocol listener. HTTP.sys listens for…

0

Hunting Down a Classic Error: “Page Cannot be Displayed”

Was assisting a customer on a critical server-down situation with a very generic error: “Page cannot be displayed….”. This is a classic error and puts you on an open-ended troubleshooting venue. One of the things you want to do first is to ask yourself few questions: Wasn’t this Server working fine when it restarted last…

0

Hosting multiple websites: IP or Host Headers?

IIS supports multiple Web sites on a single server. To create and host multiple Web sites, you must configure a unique identity for each site on the server. To assign a unique identity, distinguish each Web site with at least one of three unique identifiers:  an IP address, or a TCP port number or a…

1

Screencast: Using Glimpse with Windows Azure Web Sites

Glimpse is a great open source diagnostic tool for web applications. Glimpse runs in your browser (it’s all HTML, so no plug-ins required), and it gives you a glimpse into what’s happening on the server when your code executes. You can see what methods are executing, how long code takes to run, configuration information, and…

0