AD User Editor

Print PDF
Article Index
AD User Editor
Setup
Configuration
Sources, Evolutions and Modifications
All Pages

AD User Editor is a webpart for MOSS 2007 that allows to easily modify any profile property of any person in Active Directory. Il can also be configured as "self-service" for a user to be able to modify his properties only.

AD User Editor

  • 5 different types of properties fields: Simple TextBox, DropDownList/ListBox (with predefined values), People Picker, Date Picker with calendar.
  • Multi-domain compatible.
  • Nearly Any Active Directory property can be easily added or removed of the edit form, directly trough the webpart configuration (nothing "hard-coded").
  • SharePoint "look & feel"
Warning: This tool modify data in Active Directory. Be careful setting the user access rights. It has been tested and verified, but I cannot be held responsible for any loss of data - use at your own risk.

Download AD User Editor (CodePlex)


Setup

  1. Download the archive and unzip it to the server where MOSS 2007 is installed. Then run setup.exe to install (*).
  2. Go the site collection where you installed it.
  3. Go to "Site Actions>Modify all parameters" and click on "Site Collection Features". If everything went well, you should find the feature you've just installed (Nomine SharePoint Tools).
  4. Push the button "Activate" in front of it.
  5. Create a new webpart page or modify the one you want and add the webpart "AD User Editor".
  6. You're almost done!
(*) If the installer doesn't work:
- Open a console (Start menu>execute>cmd) and type in the following instructions:
cd <path_to_installer>
stsadm -o addsolution -filename NomineSharePointTools.wsp


- Go to your SharePoint "Central Administration" and click on the tab "Operations".
- There, you should click on the link named "Solution Management" under the title "Global Configuration".
- If everything went well, you should find the solution you've just installed (NomineSharePointTools.wsp).
- Click it, choose "Deploy Solution", select the Web Application you want it to be deployed to and then click "OK".

 

It's over for Central Administration. Now, It's time to go to the site collection you want to add the WebPart.

  1. Go to its parameters (Site Actions>Modify all parameters).
  2. Click on "Site Collection Features". If everything went well, you should find the feature you've just installed (Nomine SharePoint Tools).
  3. Push the button "Activate" in front of it.
  4. Create a new webpart page or modify the one you want and add the webpart "AD User Editor".
  5. You're almost done!

Configuring of the WebPart

AD Controller(s)

You can click the three dots to view it better (and maybe copy-paste it to your favourite text editor).

This is for the webpart to understand which domain controller it should connect in order to edit an user.

Here is an example configuration for 2 domains:

<domains>
   <domain name="PESSAC" path="LDAP://srvpscinfo.pessac.mydomain.com/DC=pessac,DC=mydomain,DC=com" usr="xxxx" pwd="yyyy">
   <domain name="VENISSIEUX" path="LDAP://srvvnxinfo.venissieux.mydomain.com/DC=venissieux,DC=mydomain,DC=com" usr="xxxx" pwd="yyyy">
</domains>

There are 4 parameters:

  • name: It is the Netbios domain name (the netbios name is what you type before your login. eg: if you type VENISSIEUX\nomine, then the netbios name is VENISSIEUX)
  • path: It's the path to connect to the corresponding Active Directory controller (eg: "LDAP://adserver1.domain.com/DC=domain,DC=com").
  • usr: Username of an account that has Read/Write access to this Active Directory controller.
  • pwd: Password of this account.

AD Properties

Here you can configure all the profile properties that you want to appera in the edit form.

Here is an example configuration:

<properties>
   <property adname="displayName" name="Full Name" type="textbox" values="" />
   <property adname="sn" name="Last Name" type="textbox" values="" />
   <property adname="givenName" name="First Name" type="textbox" values="" />
   <property adname="manager" name="Manager" type="person" values="" />
   <property adname="assistant" name="Assistant" type="person" values="" />
   <property adname="department" name="Service" type="listbox" values="IT;Human Resources;Bio;Security" />
   <property adname="title" name="Title" type="textbox" values="" />
   <property adname="employeeType" name="Employee Type" type="dropdown" values="Technician,tech;Manager,mgr;Director,dir" />
   <property adname="telephoneNumber" name="Telephone number" type="textbox" values="" />
   <property adname="mobile" name="Mobile" type="textbox" values="" />
   <property adname="facsimileTelephoneNumber" name="Fax" type="textbox" values="" />
   <property adname="l" name="Town" type="dropdown" values="New-York;Washington" />
   <property adname="physicalDeliveryOfficeName" name="Office" type="textbox" values="" />
   <property adname="company" name="Company" type="textbox" values="" />
   <property adname="accountExpires" name="Departure Date" type="date" values="" />
</properties>

A "property" field has 4 different properties:

  • adname: The LDAP name of the property you want to modify.
    (You can find a list of all LDAP property names on www.imibo.com)
  • name: The name you want to display in the edit form
  • type: Which type you want the field to be:
    • textbox: Simple text-box. Comon way of editing things.
    • dropdown: Dropdown list with a choice of predefined values.
    • listbox: If a dropdown list would be too long, this is the best solution. It works as "dropdown".
    • person: People Picker to select any people that SharePoint will find in Active Directory.
    • date: Date Picker with calendar.
  • values: The predefined values in ListBox and DropDownList. Can be defined two ways:
    • Values separated by semicolons(;)
    • OR Pair of displayed_title/inserted_value. Each item separated by semicolon (;) and each pair divided by a comma (,)

I tried to be as clear as possible. Don't hesitate to put your question in comments if your not sure...

Check the box to transform the WebPart into "self-service".


References

I picked a lot of infos and get inspirated by some bits of source code googling the web. My most important sources of inspiration and help were:

Wishes List

  • More friendly property editor in webpart configuration (like toolpart in this webpart, or from an external list)
  • Encode connexion strings (no more clear text)
  • Make it really multilingual (cf here)
  • Code it the MVC way (at least separate presentation elements from data)
  • Add multi-valued field to properties control types (find the sharepoint one which does this task)
  • Package it with SharePoint Solution Installer

Before trying to compile something

  1. Use a server with MOSS 2007 and Visual Studio 2008 installed on it (not tested with VS2005 and WSS3 alone)
  2. Install Visual Studio Extensions for Sharepoint from here
  3. Download and install STSDEV from here
  4. Unzip the project archive and open NomineSharePointTools.sln with Visual Studio
  5. Edit DeploymentFiles/Microsoft.SharePoint.targets to make targetUrl, WssRootFilesFolder, STSADM and STSDEV match your server config.
  6. Click the menu "Generate>Config Manager" and select DebugDeploy or DebugUdate depending on what you did before.
  7. Press F5: It should compile and install (don't care if VS tells you a class can't be directly launched)
  8. You just have to activate the feature on you site collection and then add the webpart to a test page.
  9. Next, each time you'll update, the webpart will be automagically updated.

 

Conclusion

Thank you for trying my WebPart. It's my first real developement for SharePoint 2007, so feel free to send any constructive comment to help me making it even better.

Comments  

 
+1 #10 Mansoor 2010-05-19 04:37
Hi alex,

Can we make readonly field,and can we make mandatory field ?

If yes, please tell its very need in my project.

regards
Mansoor
Quote
 
 
0 #9 Agreepini 2010-03-21 14:14
The most advanced resource for people TTT
Quote
 
 
0 #8 Alexis 2010-03-16 06:46
Marcelo,
It could be a problem of credentials.
Please check that the login you put in the xml config is like this: "DOMAIN\username "
Quote
 
 
0 #7 Marcelo Estrada 2010-03-15 20:27
Hi Alexis:
I have sucessfully configured the AD User Editor Webpart, however if I try to get an account from the PersonPicker and then edit it it launches the following error message:
System.DirectoryServic es.DirectoryServic esCOMException (0x8007202B): A referral was returned from the server. at System.DirectoryServic es.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServic es.DirectoryEntry.Bind() at System.DirectoryServic es.DirectoryEntry.get_AdsObject() at System.DirectoryServic es.DirectorySearch er.FindAll(Boolean findMoreThanOne ) at System.DirectoryServic es.DirectorySearch er.FindOne() at NomineSharePoin tTools.ADUserEditor.findFromAccount Name(String Name) at NomineSharePoin tTools.ADUserEditor.selectUser()

Any suggestion or possible troubleshooting for solving this issue would be highly appreciated!!
BTW, Excellent Webpart, I´m really excited to try it on, please help!!
Quote
 
 
+1 #6 Alexis 2010-03-04 15:09
Steev,
The issue is related to the xml config in the webpart:
check here for more info: http://nominesptools.codeplex.com/Thread/View.aspx?ThreadId=69492
Quote
 
 
0 #5 Steev 2010-02-18 17:17
Hello, I am having some trouble getting the WebPart to work.

I have installed it successfully and added it to a MOSS page, but I get an error.

I seem to get the same error whether I enter my DC creds or not.

The error is

"System.Collections.Generic.KeyNotFoundExce ption: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoun dExce ption() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at NomineSharePoin tTools.ADUserEditor.findFromAccount Name(String Name) at NomineSharePoin tTools.ADUserEditor.selectUser"

Fairly noob at this so it's probably something obvious I am missing. I would appreciate any help you can give me as the WebPart is exactly what I am looking for.

Thanks.

Steev.
Quote
 
 
+1 #4 Tom J 2010-02-16 12:30
Excellent web part. See link for configuration gotchas I found. Main thing is to make the 'Edit current user only' property non-editable when modifying the web part in personal mode.
Quote
 
 
0 #3 Ivo Markov 2010-02-04 11:29
Hi, great toll but one real nice option is missing. There is no way to pass the current logged in in MOSS user's credentials to the AD. It'll be very nice to have that as setting administrator account into the WebPart configuration is not an option in most companies. Anyway, user by default can change some of his attributes in AD, and if passing his credentials automatically is possible this tool can be useful in more scenarios.
It's pretty simple to do it in WebApp, I think can be done in WebPart.
Quote
 
 
+2 #2 mlem 2010-01-07 01:12
Great tool, Alexis. Is there a way to make a field read-only?
Quote
 
 
+1 #1 pettsen 2009-12-09 09:44
Great job
Quote
 

Add comment


Security code
Refresh

Documentation:
Creative Commons License

Source Code:
GPL v3

If you like my work: