Looking for the meaning of DirectoryEntry.Properties["Syntax"].ToUpper() == "BOOLEAN"

Posted on 2012-09-19
Last Modified: 2012-09-19

I'm currently maintaining and reviewing some old code found in a legacy application. At some point, this app is talking to the Active Directory to create a new virtual Directory.

However, before doing so, it ensures that a property "Syntax" is different from "BOOLEAN":

System.DirectoryServices.DirectoryEntry schemaIIS;
schemaIIS = new System.DirectoryServices.DirectoryEntry("IIS://someServer/Schema/AppIsolated");

if (schemaIIS.Properties["Syntax"].ToUpper() == "BOOLEAN") {
    throw new Exception("cannot create app on server.");

Open in new window

I've been looking all over the Web to find the meaning of this one. I have found a lot of examples verifying this condition in a similar way...  Yet, I haven't found any explanation about what it actually does / what it means.  It must have something to do with the "AppIsolated" schema but I can't see what it is.

Any help would be appreciated!


Question by:l-ipse
    LVL 25

    Accepted Solution

    Read the text about the AppIsolated property here:

    So in your code, the programmer is checking that IIS version is upper to 4.0. If 4.0 or lower, the AppIsolated property is a boolean value; if 5.0 or upper, it's a numeric value.

    Hope that helps.
    LVL 50

    Assisted Solution

    by:Julian Hansen
    Can't say for sure but I am guessing that it is checking to see if the Syntax of the AppIsolated property is BOOLEAN and if it is preventing the code from continuing.

    Looking here

    AppIsolated appears to allow 0,1 or 2 as values - which is clearly not boolean - so if Syntax is boolean then it does not support the above options and based on that the code is deciding it cannot continue.

    That's how I interpret it anyway.

    Author Closing Comment

    Thank you very much guys!  That makes sense.  If IIS version is 4.0 or lower, the process cannot continue because the application doesn't support it: later in the same code, the AppIsolated property is set to 2 so the new webapp is pool-processed...

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now