473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Re: SDS.AM Extensions

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

Thanks, bob
"Bob Weiner" <Bo*******@community.nospamwrote in message
news:70**********************************@microsof t.com...
>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

Jul 14 '08 #1
0 972

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: jacob navia | last post by:
Has anyone here any information about how arrays can be formatted with printf? I mean something besides the usual formatting of each element in a loop. I remember that Trio printf had some...
4
by: christopher diggins | last post by:
A feature that I find signficantly missing in C# is the ability to write functions in interfaces that can call other functions of the interface. Given an interface ISomeInteface the only way we can...
4
by: Lee Forst | last post by:
What is all required to run an ASP.NET application on an IIS server? Of course you would need to have the .NET Framework installed, but do you have to have the ASP.NET Extensions installed? What...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
10
by: musosdev | last post by:
Hi guys I'm trying to migrate to VS2005... I've managed to do that, but realised I'd opened my web projects as file projects, and I'm getting the error about network BIOS command limit. ...
59
by: Anando | last post by:
Hi, I have a linear singly linked list of 100 elements. I would like to prune it such that only user specified elements (say only the elements 1, 13, 78 and 100 of the original list) survive...
2
by: antonyliu2002 | last post by:
I am testing AJAX. I've downloaded the AJAX Extension and the CTP December package and installed on BOTH my development machine and the production server. Then I created a very very simple web...
2
by: kelvin.koogan | last post by:
Our company has a mix of users with VS2003 & VS2005. I'm am having difficulty working out how components written with these 2 tools can be written together. I want to be able to a) incorporate a...
1
by: Yan | last post by:
Hi, I'm apparently far from being the 1st one to meet this error... My asp.net ajax page requires ScriptManager.axd but gets a 404. following a lot of "This is how I solved it" posts, I : -...
0
by: Adam Salisbury | last post by:
**To members of microsoft.public.dotnet.framework, apologies for the crosspost. I originally posted this message into that group however have since realised this may have been a better...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.