Posts Mentioning RSS Toggle Comment Threads | Keyboard Shortcuts
-
Chewy Chong
-
Chewy Chong
Viewing all Web Server Variables with a few lines of ASP/ASPX code
ASP
<html>
<body>
<% For Each variable In Request.ServerVariables
Response.Write(“<b>” + variable + “</b><br>”)
Response.Write(“” + Request.ServerVariables(variable) + “<br>”)
Next %>
</body>
</html>ASPX (place code in the ASPX’s code behind’s Page_Load method)
Response.Write(“<b>Application Pool Credentials (Test)</b><br>”);
Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent().Name + “<br><br>”);
foreach(string aKey in Request.ServerVariables)
{
Response.Write(“<b>” + aKey + “</b><br>”);
Response.Write(Request.ServerVariables[aKey] + “<br>”);
} -
Chewy Chong
Troubleshooting the Application of Group Policy
General tips on how to troubleshoot the application of group policy.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;250842When policy is being applied, you can enable ‘tracing’ to a log file so you can see how the processing is going. This is a registry change.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;221833
<% For Each variable In Request.ServerVariables
Response.Write(“” + variable + “
“)
Response.Write(“” + Request.ServerVariables(variable) + “
“)
Next %> -
Chewy Chong
Adding an Additional Element to an Array in VBScript
This is a heck lot more painful than using a cooler language such as Java or C#. In VBS (and VB), an array defined with a set size. If you want to add an additional element to the array (therefore increasing the array size by 1), you need to redeclare the array using the ‘ReDim’ command. To keep the information stored w/in the array, use the ‘Preserve’ key word.
ReDim Preserve MyArray( UBound(MyArray) + 1 )
MyArray( UBound(MyArray) ) = newElement -
Chewy Chong
IIS 6 HTTP Compression (GZip) with ASP.NET
Did you know IIS 6 has the capability to compress HTTP traffic? You’ll need a browser that can uncompress this traffic also but the performance gains are rather good. IIS will check to see if the browser supports this feature and turns it on whenever applicable.
I did some performance measurements a while back for a client. IIS 6 for Outlook Web Access 2003. It compresses everything including mail attachments. Good performance.
The .NET guy has good ‘how-to’ here:
http://dotnetguy.techieswithcats.com/archives/003475.shtml -
Chewy Chong
Using MOM to Check Group Policy Health
Microsoft just released a new MOM management pack. I’m glad they did because my project was just about to ask me to put something like this together. Talk about good timing!
The Group Policy Management Pack for Microsoft Operations Manager (MOM) monitors Group Policy infrastructure and in-scope client side extensions. Specifically, it:
- Provides Group Policy health monitoring for:
- Group Policy core infrastructure/registry client-side extension
- Scripts client-side extension
- Software installation client-side extension
- Security client-side extension
- Folder redirection client-side extension
- Disk quota
- Provides a knowledge base of useful information to help administrators resolve an issue when Group Policy fails to process.
- Provides Group Policy health monitoring for:
-
Chewy Chong
Programmatically Accessing All Objects in IIS
One of my co-workers was attempting to modify the Application Pool used by a Web Application. In her tests, she noticed that even after changing the Application Pool used by a Web App via the GUI, her script always reported she was using the ‘Default App Pool’. I wrote the following to iterate through all objects in IIS. This was our result:
1 (IIsWebServer) AppPool = DefaultAppPool
Filters (IIsFilters)
IIsCertMapper (IIsCertMapper)
ROOT (IIsWebVirtualDir) AppPool = ChewyPool
aspnet_client (IIsWebDirectory) AppPool = ChewyPool
AppPools (IIsApplicationPools)
ChewyPool (IIsApplicationPool)
Filters (IIsFilters)
ASP.NET_1.1.4322.573 (IIsFilter)
Compression (IIsFilter)
deflate (IIsCompressionScheme)
gzip (IIsCompressionScheme)
Parameters (IIsCompressionSchemes)
Info (IIsWebInfo)
Templates ()
Public Web Site (IIsWebServer) AppPool = DefaultAppPool
Root (IIsWebVirtualDir) AppPool = DefaultAppPool
Secure Web Site (IIsWebServer) AppPool = DefaultAppPool
Root (IIsWebVirtualDir) AppPool = DefaultAppPool
87257621 (IIsWebServer) AppPool = DefaultAppPool
filters (IIsFilters)
root (IIsWebVirtualDir) AppPool = ChewyPool
You’ll notice the default IIsWebServer (denoted by the server id number ‘1’) reports using the ‘Default App Pool’. I believe this parameter exists due to inheritance and the value is not referenced by IIS. You’ll notice the actual App Pool value we set via the GUI (ChewyPool) shows up on a member IIsWebVirtualDir object called ROOT. This appears to be where IIS stores which App Pool is used by the Web Application.
The script used to dump the above info is as follows:
Dim objWebApps
Set objWebApps = GetObject(“IIS://localhost/W3SVC”)
Dim objWebApp
RecurDump objWebApps, “”
Sub RecurDump (objNode, strSpacing)
Dim objSubNode
For Each objSubNode In objNode
If (objSubNode.KeyType = “IIsWebServer”) Then
WScript.Echo strSpacing & objSubNode.Name & ” (” & objSubNode.KeyType_
& “) AppPool = ” & objSubNode.AppPoolID 
; Elseif (objSubNode.KeyType = “IIsWebVirtualDir”) ThenWScript.Echo strSpacing & objSubNode.Name & ” (” & objSubNode.KeyType_
& “) AppPool = ” & objSubNode.AppPoolID
Elseif (objSubNode.KeyType = “IIsWebDirectory”) Then
WScript.Echo strSpacing & objSubNode.Name & ” (” & objSubNode.KeyType_
& “) AppPool = ” & objSubNode.AppPoolID
Else
WScript.Echo strSpacing & objSubNode.Name & ” (” & objSubNode.KeyType_
& “)”
End If
RecurDump objSubNode, strSpacing & “ “
Next
End sub
-
Chewy Chong
Understanding Kerberos
No… not the three headed dog that guards the entrance to Haides but rather, the authentication mechanism used in Windows 2000+.
Simple Explanation
http://www.microsoft.com/technet/prodtechnol/windows2000serv/maintain/security/kerberos.mspxHard Core Explanation (more fun)
http://www.microsoft.com/technet/prodtechnol/windows2000serv/deploy/confeat/kerberos.mspxWhy did they need a dog to guard the entrance of hell? (Includes a picture)
http://www.theoi.com/Tartaros/Kerberos.html -
Chewy Chong
ADSI VBS Script Snippets for IIS 6 App Pool/Web App Manipulation
Here’s a few snippets of VBS code I wrote while trying to automate the creation of the web app and associated application pool for the project. For more information about the IIS ADSI Provider (ADSI is the mechanism I used to do all this.. you can also use WMI):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/iis/ref_prog_iaoref.aspOption Explicit
‘ —- Creates an Application Pool and assigns pool credentials
Dim objAppPools, objAppPool
Set objAppPools = GetObject(“IIS://localhost/w3svc/AppPools”)Set objAppPool = objAppPools.Create(“IIsApplicationPool”,”Sample-App-Pool”)
objAppPool.WAMUserName = “test\test1″
objAppPool.WAMUserPass = “test1″objAppPool.SetInfo
‘ —- Loop through all IIS Application Pools on the server
‘ —- Shows the user credentials used by the pool
Dim objAppPools, objAppPool
Set objAppPools = GetObject(“IIS://localhost/w3svc/AppPools”)For Each objAppPool In objAppPools
WScript.echo “AppPoolName = ” & objAppPool.Name & “(” & objAppPool.KeyType & “)”
wscript.echo “ User= ” & objAppPool.WAMUserName
wscript.echo “ Pass= ” & objAppPool.WAMUserPass
Next‘ —- Loop through all IIS Objects on the server (Web Apps, App Pools, Filters, etc)
‘ —- If it is a IISWebServer, display the application pool used
Dim objWebApps
Set objWebApps = GetObject(“IIS://localhost/w3svc”)Dim objWebApp
For Each objWebApp In objWebApps
wscript.echo “WebAppName = ” & objWebApp.Name & “(” & objWebApp.KeyType & “)”
if (objWebApp.KeyType = “IIsWebServer”) then
wscript.echo “ PoolID = ” & objWebApp.AppPoolID
end if
Next‘ —- Shows the type of object returned
Set objWebApp = Getobject(“IIS://localhost/W3SVC/2/Root”)
wscript.echo “Object Type Returned = ” & objWebApp.KeyType -
Chewy Chong
IIS 6.0 Blogs by the Microsoft IIS PMs
Want to know some interesting bits about IIS 6 from the people who knows it inside and out?
Rich Ersek
http://blogs.gotdotnet.com/richarde/Thomas Deml
http://iisgeek.no-ip.com/