Monday, August 24, 2009

Error when configuring SharePoint Services Search Service

You probably know this already this is just a notice to self :-)

When configuring a SharePoint Services Server running everything locally you normally specify the user accounts only by the username during the installation and configuration.

When looking at the Services in the server you notice that there is one service that is not starting. The “Search Service”. You click on the start link and the configuration page pops up. You enter all the user settings and click on start. After a second or two a rather generic error message appears SPSearch(Username).

After rechecking passwords and usernames you try again, with the same result…

The problem is that the “Service Account” username must have domain\user or server\user syntax (server\user in this case)

The “Content Access” Account can be specified using the username only (But it does not hurt to add the server name as well)

Search_Service_Account

Thursday, August 6, 2009

Change a users property in Active Directory

In order to change a users property you must get the DirectoryEntry for the user. Below are some simple code that I have been using in my “AD import Tool”

GetUser – Returns a DirectoryEntry that can be used to get and set properties for a user object i AD (Click for a larger image, code is at the end of the post)

GetUser Example

The function used in a wrapper class along with other code mainly gathered in the Howto: (Almost) Everything In Active Directory via C# at CodeProject.

 

ADHelper GetUser Example

You can download the ADHelper class here

Note: This is a only a simple example. It has not been tested thoroughly for memory leaks.

Can not find property “mobile” in Active Directory

While developing an application used to import mobile phone numbers from a CSV file to Active Directory I discovered that the attribute “mobile” did not exist for users where this property never had been used before (Never been updated by other tools such as the Active directory MMC snap-in etc.)

The application uses the standard System.DirectoryServices.ActiveDirectory assembly shipped with .NET 2.0. (See the article on CodeProject Howto: (Almost) Everything In Active Directory via C# for more code)

mobile

The source code after gathered the Directory Entry for a user. Is used to update the mobile attribute:

mobile

Do not forget to CommitChanges, Close and Dispose…