Re: SDS.AM Extensions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Weiner

    Re: SDS.AM Extensions

    didn't get a lot of love from the dotnet.framewor k group. Maybe someone
    here has some experience with AD programming.

    Thanks, bob


    "Bob Weiner" <BobWeiner@comm unity.nospamwro te in message
    news:705EEC5B-1BD5-4C8D-AEB6-31C971B85FE5@mi crosoft.com...
    >I like the new System.Director yServices.Accou ntManagement namespace. It
    >seems like it will make a lot of things easier to manage.
    >
    I am having trouble understanding how to extend and use the UserPrincipal
    to get some things done. These include searching and updating the
    proxyAddresses attribute for users. I tried to do this by Extending the
    UserPrincipal as follows:
    [DirectoryObject Class("User")]
    [DirectoryRdnPre fix("CN")]
    public class Account : UserPrincipal {
    >
    // Constructor
    public Account(Princip alContext ou, string samAccountName, string
    password) : base(ou, samAccountName, password, true) { }
    >
    [DirectoryProper ty("proxyAddres ses")]
    public string[] ProxyAddresses {
    get {
    int len = ExtensionGet("p roxyAddresses") .Length;
    string[] addresses = new string[len];
    object[] addressesRaw = ExtensionGet("p roxyAddresses") ;
    for (int i = 0; i < len; i++) {
    addresses[i] = (string)address esRaw[i];
    }
    >
    return addresses;
    }
    >
    set { ExtensionSet("p roxyAddresses", value); }
    }
    >
    I can use this to create a new account (User) in the AD but cannot use it
    to retrieve the proxyAddresses. The various find methods only return
    Principals or UserPrincipals and I cannot cast them to Account. I am
    using http://msdn.microsoft.com/en-us/library/bb552835.aspx as a model to
    work from.
    >
    How can I access/update/search the proxyAddresses field for users?
    >
    Thanks, bob
    >
    >
    >
    >
Working...