Share via


Listing User Rights

Listing User Rights

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release. Listuserrights.asp renders a list of user rights in a table.

<%
// This sample lists all the users, their properties and masks in a DACL object.
function ListUserRights(itemURL)
{
    var objDacl = CreateSecurityDACL(SECURITY_ON_SERVER());

    // Load the security descriptor in dacl object.
    var objLoadResult = objDacl.Load(itemURL);
    if (objLoadResult.number != 0)
    {
          Response.Write("<b>Failed to Load: " + objLoadResult.description + "</b><br>");
        return (objLoadResult.number);   //error loading the object ...maybe the url does not exist....
    }
     ShowSecurityDACL(objDacl); //print the dacl
    return(0);
}

function ShowSecurityEntity(entity)
{
     Response.write ("<td>" + entity.SID + "</td>")
     Response.write ("<td>" + entity.DisplayName + "</td>")
     Response.write ("<td>" + entity.NT4Name + "</td>")
     Response.write ("<td>" + entity.SIDType + "</td>")
     Response.write ("<td>"
                + " " + entity.Masks[0]
                    + " " + entity.Masks[1]
                    + " " + entity.Masks[2]
                    + " " + entity.Masks[3]
                    + " " + entity.Masks[4]
                    + " " + entity.Masks[5]
                    + "</td>")
     Response.write ("<td>" + entity.Inherited + "</td></tr>")
}

function ShowSecurityDACL(dacl)
{
     var i;

     Response.write ("<b>Object.: '" + dacl.URL + "'</b><br>")
     Response.write ("Count: " + dacl.Count + "<br>")
     Response.Write ("<Table border cellspacing=0 cellpadding=5>");
     Response.Write ("<tr><th>Role</th>"
                         +"<th>SID</th>"
                         +"<th>DisplayName</th>"
                         +"<th>NT4Name</th>"
                         +"<th>SIDType</th>"
                         +"<th>Mask</th>"
                         +"<th>Inherited</th></tr>");
     for (i = 0; i < dacl.Count; i++)
     {
          Response.write ("<tr><td>" + i + "</td>")
          ShowSecurityEntity(dacl.Entities[i])
     }
     Response.Write ("</Table>");
}
%>



                

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.