How to log client IP when IIS is load balanced: the X-Forwarded-For Header (XFF)

X-Forwarded-For Header (XFF) is essential whenever we have a Proxy or LoadBalancer between client browser and IIS. This way, the proxy or load balancer will forward the client’s IP to IIS, hence giving the IIS the much needed info to track the incoming user. You need to check your Proxy or Load balancer documentation on…

0

FIPS compliant machinekey section for IIS Application

One of my customers needed to configure his ASP.NET site under FIPS. The information was scattered in various MSDN blogs and docs. To prevent the good work go to waste, I am blogging it here so that others can be benefited as well: FIPS compliant machinekey section in web.config: <machineKey validationKey=”XXXXXXXXXXXXXXXXXXX”   (same key for all…

0

Forcing IIS to write logs (HTTP and FTP)

I was assisting a customer who was trying several different configurations but his IIS log was not reflecting any of these changes. This can be frustrating at times since you always expect the logs to be written corresponding to your actions. By default, starting with IIS 7.0, IIS HTTP logs are written once every 1…

0

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