PC Review


Reply
Thread Tools Rate Thread

SDS.AM Extensions

 
 
Bob Weiner
Guest
Posts: n/a
 
      9th Jul 2008
I like the new System.DirectoryServices.AccountManagement 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:
[DirectoryObjectClass("User")]
[DirectoryRdnPrefix("CN")]
public class Account : UserPrincipal {

// Constructor
public Account(PrincipalContext ou, string samAccountName, string password)
:
base(ou, samAccountName, password, true) { }

[DirectoryProperty("proxyAddresses")]
public string[] ProxyAddresses {
get {
int len = ExtensionGet("proxyAddresses").Length;
string[] addresses = new string[len];
object[] addressesRaw = ExtensionGet("proxyAddresses");
for (int i = 0; i < len; i++) {
addresses[i] = (string)addressesRaw[i];
}

return addresses;
}

set { ExtensionSet("proxyAddresses", 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




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extensions, Extensions and more Extensions ACCESS just do it rebelscum0000 Microsoft Access 5 14th Apr 2007 10:35 PM
Extensions, Extensions and more Extensions ACCESS just do it rebelscum0000 Microsoft Access 0 12th Apr 2007 06:30 PM
FP extensions. =?Utf-8?B?RG9uRnJlZGk=?= Microsoft Frontpage 4 14th Jul 2005 05:25 PM
FP extensions versus SharePoint and latest version of FP extensions Fran Microsoft Frontpage 4 15th Mar 2005 05:33 PM
FP Extensions Tommy Microsoft Frontpage 2 11th Jul 2004 12:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:40 AM.