Copying User Masks

Copying User Masks

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. Copyusermasks.asp grants a user in Microsoft® Active Directory® rights on an item. These rights are copied from the rights that another user has on the same item.

<%
// This sample shows how to add a user (User2) that mask is a copy of a different users (User1) on same item.
function CopyUserMasks(user1, user2, itemURL)
{
    var objDacl = CreateSecurityDACL(SECURITY_ON_SERVER());

    // Load the security to dacl.
    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....
    }

    var objResult = objDacl.CopyUserMasks(user1, user2);
    if (objResult.number != 0)
    {
        Response.Write("<b>Failed to Copy UserMasks: " +objResult.number + " "+ objResult.description + "</b><br>");
       return(objResult.number);
    }

    objResult = objDacl.Save();
    if (objResult.number != 0)
    {
        Response.Write("<b>Failed to Save DACL: " +objResult.number + " "+ objResult.description + "</b><br>");
       return(objResult.number);
    }
 return 0;   //no errors
}
%>

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.