Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

List all Portal Users

  Asked By: Micah    Date: Aug 04    Category: Sharepoint    Views: 983

I am trying to create a web part that has a drop-down box that lists
all the portal users. When a user is selected it displays their e-
mail address in a label.

I have been trying to use the audience manager with no luck.

Does anyone know how to does this??



5 Answers Found

Answer #1    Answered By: Kelly Fowler     Answered On: Aug 04

I have done some programming like this. Basically you are going to need to get a list  of users  from Active Directory utilizing the DirectoryEntry object and LDAP. Then you can get your list of people to bind to the combobox. Then when the user  selects an item from the combobox, you can go back to Active Directory and get a DirectoryEntry object for that particular user. Then you'll be able to retrive all of the user's attributes.

You can find this on the web  - just do a search for some of the terms above. If you can't find anything, then let me know and I can post some code.

Answer #2    Answered By: Fabian Gross     Answered On: Aug 04

Thought about your question some more. You can also use the profilemanager object from the SharePoint SDK. I was utilizing Active Directory because I was workign on ways for the SharePoint users  to manage their account (ie. change passwords, etc.).

Answer #3    Answered By: Drew Armstrong     Answered On: Aug 04

I am going to use Active Directory to establish a link between
manager and user  but an security keeps popping up when I run the web
part (System.Security.SecurityException: Security error). here is my

string dom ="mountain";

entry = new System.DirectoryServices.DirectoryEntry("LDAP://" + dom);
mySearcher = new System.DirectoryServices.DirectorySearcher(entry);
mySearcher.Filter = ("(objectClass=user)");
(System.DirectoryServices.SearchResult resEnt in mySearcher.FindAll

(new ListItem(de.Properties["DisplayName"].Value.ToString()));
("Email : " + de.Properties["Mail"].Value.ToString());
("Title : " + de.Properties["Title"].Value.ToString());

Name : " + de.Properties["sAMAccountName"].Value.ToString());
Name : " + de.Properties["GivenName"].Value.ToString());

Name : " + de.Properties["sn"].Value.ToString());
("Initials : " + de.Properties["Initials"].Value.ToString());

("Company : " + de.Properties["Company"].Value.ToString());
("Department : " + de.Properties["Department"].Value.ToString());
("Telephone No. : " + de.Properties["TelephoneNumber"].Value.ToString

I have added the System.DirectoryServices.dll and it doesn't work.

Any ideas??

Answer #4    Answered By: Marshall Castro     Answered On: Aug 04

I ran into a few problems with getting connection to Active Directory Domain Server. Basically I was trying to access it from my development box  via LDAP://myadserver, etc. I couldn't get this to work at all, even if I was passing it the right credentials. What I ended up having to do was scrap trying to run and test it from my development machine. You can just use :
entry = new System.DirectoryServices.DirectoryEntry(LDAP://localhost and the connection information of a user  that has rights to the active directory.

Here's what I did:
Dim myDirectory As New DirectoryEntry(LDAP://localhostCN=users,etc., "adminaccount", "password", AuthenticationTypes.Secure)

Answer #5    Answered By: Terrell Bates     Answered On: Aug 04

U would do well to look at Code Access Security.....

Code Access Security for Developers

Code Access Security for Administrators

Didn't find what you were looking for? Find more on List all Portal Users Or get search suggestion and latest updates.