.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem Import Pictures into User Profiles from Active Directory

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :C#

I have problems with getting the pictures from Active Directory (Field "thumbnail Photo") into my Sharepoint User Profile Store and displaying it in the MySites.

Profile Synchronization is working fine, the field Picture is mapped to thumbnailPhoto.

Then for finishing the process I execute the following powershell command: 

Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation "http://mysite.vz.ch/my"

I execute this command under the user context from the account which has all the necessary AD-Rights. I do this with "start-job -Credentials $cred -ScriptBlock $sb" where -Credentials for the AD Sync Account and $sb for the above Powershell Script (Update-SPProfile....).

For this I had to give rights to the sync account on the user profile service application (administrator and permission button, I know). Also I had to give "db-owner"rights on the Configuration Database and also on the MySite Database for this sync account. I found this out via ULSLogViewer.

Now it is working as far that the scripts enumerates all user profiles and tries to process the images. But in ULSLogViewer I have the following error message:

"Error processing the photo URL User Photos/Profile Pictures/0c37852b-34d0-418e-91c6-2ac25af4be5b_652.jpg for user ZH01\BEr: System.U

View Complete Post

More Related Resource Links

Import user profile from another domain active directory

Hi, I have SharePoint 2010 running on DomainB andwe have corporate users on DomainA. i need to import users from both domainA and DomainB. I am able to import users from domainB and not able to import users from DomainA. I made a successful connection to both Domain A Ad and DomainB AD in SharePoint 2010 user profile synchronize connections. I am able to sync users only from DomainB (SharePoint 2010 running on domainB) and not able to synchronize profiles from DomainA (outside domain). Is there any additional configuration I need to do. Please help me on this issue. Thanks, Ratna

Unable to see Active Directory Groups in the User Profile Database after Profile Import

SharePoint Server 2010 Enterprise RTM. W2K8R2 w/multi-server setup: AD/DNS SQL 2008 WFE APP Claims Mode Web App only using Windows Integrated Auth So, this was never a problem in 2007, and I didn't even realize it was a problem in 2010 until I started to build a solution that utilized my blog article: InfoPath - User Roles in Browser-Enabled Forms Using AD Groups.  I went to utilize the same web method of the same web service, but I noticed that no data was showing up at all.  Typically, the GetUserMembership/GetCommonMembership methods return the specified user's memberships: AD Security Groups, AD Distribution Lists, and SharePoint Sites (not SharePoint Groups, though). My user profile sync is working.  All AD users are pulled in with the proper profile data. "Users and Groups" is selected in the Synchronization Entities section of my Sync Settings. Security groups are working for permissions and audience targeting.  Confirmed my users are affected properly by the use of Security Groups. My query to the GetUserMemberships web method (and GetCommonMemberships) is running (not failing), but it's not returning anything even though my user is in some Security Groups and has explicit membership to multiple sites. The GetUserProfileByName method of the same UserProfileService.asmx web service returns all the regular profile data

Synchronising the Active directory with User Profiles in sharepoint site


When the display names in Active directory is modified,its not reflected in when user logins to the site?

as Welcome Modified User Name

How to synchronize if there is change in user Name or display name in sharepoint 2007

Error on Display user's fullname using Active Directory in asp.net using vb.net



wi As System.Security.Principal.WindowsIdentity =  _System.Security.Principal.WindowsIdentity.GetCurrent()



Dim a As String() = HttpContext.Current.User.

Active Directory user impersonation with forms authentication

I've written a small ASP.NET 3.5 application to allow users to update selected account attributes on their own. Everything works fine when I use Basic Authentication, but because the dialog that is presented is less than ideal, I'd like to use forms authentication to give the users more instruction on how to log in. My problem is that in order for the user to update their account information, I have to have the application impersonate them for the update actions. I've scoured the internet trying to find a solution to my issue, but nothing fits or works. I have tried setting the web.config:<identity impersonate="true" /> but that doesn't seem to work. I also have the C# code using the WindowsImpersonationContext class, but still no luck. protected void titleTextBox_TextChanged(object sender, EventArgs e) { TextBox tb = (TextBox)sender; string fieldTitle = "job title"; string fieldName = "title"; if (userDirectoryEntry == null) CaptureUserIdentity(); try { WindowsImpersonationContext impersonationContext = userWindowsIdentity.Impersonate(); if (String.IsNullOrEmpty(tb.Text)) userDirectoryEntry.Properties[fieldName].Clear();

User Profiles Service Application and Import of SharePoint 2007 SSP data

I have setup a test SharePoint 2010 Farm. I will be using this as a test upgrade of a current live SharePoint 2007 Farm. The database attach method will be used. I have replicated the web application and AAM settings of the SharePoint 2007 Farm to the SharePoint 2010 Farm and have made the 2010 Farm a DC in a new Forest. I don't want to join this to the current domain at the moment. It also has SQL server 2005 with SP3 and cumulative update 3 installed. I have just setup the User Profiles Serice Application and when I go to Manage it, I get this. Error An unexpected error has occurred.   Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: a1760e87-372f-4711-afac-3ceba34bc599 Date and Time: 8/31/2010 4:22:56 PM I have verified and configured the following. Created the Managed Metadata Service. The status is started via Service Applications and Services on Server. Created the User Profiles Service Application and ensured status is started via Service Applications. I started the User Profile Service and User Profile Synchronisation Service via Manage Services on Server.      

Problem with ChangePassword in Active Directory

Hi, i'm having a problem trying to change the password in AD. I'm developing using c# 3.5. This is my code (i have omitted some lines for brevity): String server = txtServer.Text; String container = String.IsNullOrEmpty(txtContainer.Text) ? null : txtContainer.Text; String login = txtUser.Text; String password = txtPassword.Text; String userToManage = txtUserToManage.Text; String oldPassword = txtOldPassword.Text; String newPassword = txtNewPassword.Text; using (PrincipalContext context = new PrincipalContext(ContextType.Domain, server, container, login, password)) { using (UserPrincipal user = UserPrincipal.FindByIdentity(context, userToManage)) { if (user == null) return; if (user != null) { user.ChangePassword(oldPassword, newPassword); user.Save(context); } } } If i run this code on a computer in our Domain, all is fine. But if i run the code on our customer's computer, i receive this error: Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied (exception from HRESULT: 0x80070547) The only way to make the code run correctly is to run our program under a user with more privileges then a normal user. That is, if the user logged on the computer is a normal user, our customer receives the error. But if he uses a more "powerfull" user to

Automatic deletion of "missing from import" user profiles ?

Hi everybody!Can someone help me about his subject.When I delete a user in AD, he is marked as "missing from import" in MOSS user profile database after a full import.I read that for SPS2003, after the 3rd full import, if the user is still missing, he is automatically deleted from MOSS user profile database.I tried with MOSS2007, but the automatic deletion does not seem to work.Is there something to configure in order to make it work, or how to make the deletion automatic ?Thanks a lot for your answers.jerome

Import from web service into MOSS user profiles



We have a problem which is kinda explained in this article: 

We have company portal MOSS 2007 based, and a HR database (not sql server based) which has all employee data. Right now this data is manually typed into Active directory when new employee is hired, then it gets imported into MOSS (automatical import). 

We would like, for example, to import birth date, which has no field for in AD, directly from HR, and we also would like to import other fields from HR database. I can write custom web services in the HR base to give out this data.

I tried to read the article above but i understood nothing. Author tells to write some xml but i dont understand where do i put that xml. And it seems that he is importing from SQL server database but in my case it will be an xml output of a web service!

There is also an article by the author about writing custom code  here


Is there a way to undo/remove/delete an active directory user profile syncronization? [SP 2010]


I successfully managed to synchronize the active directory with Sharepoint 2010.  Unfortunately, the farm I was on has different FQDN /Netbios domain names.  So all ~1000 user profiles are now imported with the wrong domain, and the subsequent errors one would expect.


Is there a way to get back to a blank slate?  technet has an article on "resetting" profile synchronization (http://technet.microsoft.com/en-us/library/ff681014.aspx), but that requires being able to verify the GUID of the user profile synchronization database, which I am also unaware of how to do.


Please help, and thank you in advance.

Active Directory User validation field in ASP.NET


I like to add a field that add active directory user in ASP.NET Web Application .




Thanks in Advance



Active Directory - User Deletion - Sync with MOSS 2007


Greetings -

I need to know if there is a sync tool that can scan all sites in a site directory and remove users that have been deleted or marked inactive within Active Directory?  I work in a company which has freaquent turn over in some positions due to internships and the like and I want to ensure that we have clean site permissions. 

Thank you for any suggested sites or addins. 


Accessing Active Directory's User Profile Information in InfoPath Form



I want the User Profile information in InfoPath Form from active directory and I want complete information of currently logged in user which include:

User Name, First Name, Last Name, Email Address, Designation, Company, Manager Name and everything which is in the profile of user in Active Directory. Please help me in getting this.


M Kamran Rafi

How do we create new User Profile Synchronization connection so that we can import profiles from AD

We have a requirement to authenticate users against Active Directory LDS in our SP 2010 farm and also import their profiles in user profile store. We are able to setup FBA using AD membership provider to authenticate against AD LDS.

I am interested in importing the users in AD LDS to SharePoint user profile store. 

When I try to create a new connection the options that I am provided are 
1. Active Directory
2. Active Directory Logon Data
3. Active Directory Resource.
4.SunOne (LDAP) 5.2
5.Novell eDirectory (LDAP) 8.7.3
6.IBM Tivoli (LDAP) 6.2

If I select any of the options 1/2/3 I am asked to provide Forest Name and Domain Controller name. Since this is AD LDS there is no Forest or Domain Controller. It’s just a generic LDAP server.  

So the question I am struggling with  is: what are the steps required to create a User Profile Synchronization connection to import users from AD LDS and not from AD DS? 

We are not able to find any information how to do that in SP2010… From other blog entries I am assuming it was supported and documented for MOSS2007.

There is NO “LDAP Directory” connection type in SP2010.

I am wondering if this is supported in SP2010.


Could not import user profiles from AD


I set up a new MSS2010 farm. I struggled with some errors such as User profile synchronization service stuck at "starting" etc., and set everything I know about. The user profile application works, I have My site host set, the user profile sync connection established, BUT...when I try syncing the profiles, only 2 profiles are imported, out of 70 in the domain.

I dont have any clue where to look. Help would be greatly appreciated.

Can I pass a user's active directory group as a parameter to reporting services?


Hi there,

I am wondering if I can pass a user's active directory group as a parameter to reporting services? If so, how can I do that (e.g. where can I get that group from?)?

Is there something as User.UserID for active directory groups?

Many Thanks and best wishes



Copy and Maintain Active Directory User details into mysql table using C#


For a given Domain name how can I retrieve the AD User details including a Unique identifier so that any changes to the user details including the username can be updated using the unique Identifier.

I can use System.DirectoryServices.DirectoryEntry to get the user details but not able to figure out how to work with the Unique Identifier to maintain the user details consistently.

Please provide me with some sample.

Thank you

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend