Update userinfo from Active Directory to Site Collection, if timer job is fucked up.
get-spuser -Web http://url -Identity domain\user
set-spuser -Web http://url -Identity domain\user -SyncFromAD
Showing posts with label Active directory. Show all posts
Showing posts with label Active directory. Show all posts
Thursday, April 18, 2013
Wednesday, March 20, 2013
Import photos from AD to SharePoint 2010
This is a time comsuming feature, here's the step for doing it right and saving time and insanity... :)
PreReq
User Profile Service application
MySite
Walkthrough
At present there is no picture associated to this user inside Active Directory.

Note- You will not see all the user attributes if you have not turned on the “Advanced Features”. You can also view the same information from ADSI.
How to import Pictures
Now our Goal is to import the user profile along with his picture, we will also upload his picture in AD.
1) First we need to make sure we are able to import users. So I will create connection to OU – PictureOU and import users

Note- I am only importing users from OU PictureOU
2) Let’s check user’s profile in SharePoint and make sure there is no picture associated to it.

Picture for this user is set to be blank
3) Upload Pictures to Active Directory.
Lots of people also have trouble in finding out ways to upload pictures in Active Directory. Following are the two best methods that I am aware off

5) Map the Picture property to Thumnail Photo
7) Let’s check the User properties and see if the image has been populated

So Picture still showing blank
8) Let’s check MIIS client and see if it made an attempt to import the picture. For this we will need to DS_DELTASYNC

So it does appear that FIM picked up the image successfully from Active Directory
9) Let’s check the Sync DB by running the following query
Select sAMAccountName,SPS_MV_OctetString_PictureURL from MMS_Metaverse with(nolock) Where SAMAccountName like '%UserName%'

So it appears Sync DB has successfully got updated with the Image.
10) Now let’s check the Profile DB by running the following query
Select NTname,PictureURL from UserProfile_full with(nolock) where NTName like ‘%harmeet%’

So it appears that Picture has not made it to the Profile DB
11) Run the following in SharePoint Management Shell
Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://mysite
http://support.microsoft.com/kb/2394320
12) Now if you go back to the user profile you will see that the image has been updated
PreReq
User Profile Service application
MySite
Walkthrough
At present there is no picture associated to this user inside Active Directory.
Note- You will not see all the user attributes if you have not turned on the “Advanced Features”. You can also view the same information from ADSI.
How to import Pictures
Now our Goal is to import the user profile along with his picture, we will also upload his picture in AD.
1) First we need to make sure we are able to import users. So I will create connection to OU – PictureOU and import users
Note- I am only importing users from OU PictureOU
2) Let’s check user’s profile in SharePoint and make sure there is no picture associated to it.
Picture for this user is set to be blank
3) Upload Pictures to Active Directory.
Lots of people also have trouble in finding out ways to upload pictures in Active Directory. Following are the two best methods that I am aware off
A. Run these commands in Windows Powershell. We need to have Windows Administrative tools loaded for this to work4) Let’s check User properties in Active Directory and make sure if has Picture value set
Import-Module ActiveDirectory
$photo=[byte[]](Get-Content C:\photo.jpg -Encoding byte)
Set-ADUser "username" -Replace @{thumbnailPhoto=$photo}
5) Map the Picture property to Thumnail Photo
A) Browse to User Profile Service Application from Central Administration and then click on Manage User Properties6) Start incremental Import
Central Administration > UPA > Manage User Properties
B) Click on Picture and then Edit
C) We need to Map this to Attribute “thumnailPhoto” and Select Import from the Direction. Make sure you click on on Add
D) After clicking on Add make sure it shows up under the “Property Mapping for Synchronization”section
E) Click on OK
7) Let’s check the User properties and see if the image has been populated
So Picture still showing blank
8) Let’s check MIIS client and see if it made an attempt to import the picture. For this we will need to DS_DELTASYNC
So it does appear that FIM picked up the image successfully from Active Directory
9) Let’s check the Sync DB by running the following query
Select sAMAccountName,SPS_MV_OctetString_PictureURL from MMS_Metaverse with(nolock) Where SAMAccountName like '%UserName%'
So it appears Sync DB has successfully got updated with the Image.
10) Now let’s check the Profile DB by running the following query
Select NTname,PictureURL from UserProfile_full with(nolock) where NTName like ‘%harmeet%’
So it appears that Picture has not made it to the Profile DB
11) Run the following in SharePoint Management Shell
Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://mysite
http://support.microsoft.com/kb/2394320
12) Now if you go back to the user profile you will see that the image has been updated
Insert photo to Active Directory
Import-Module ActiveDirectory
$photo=[byte[]](Get-Content C:\photo.jpg -Encoding byte)
Set-ADUser "username" -Replace @{thumbnailPhoto=$photo}
$photo=[byte[]](Get-Content C:\photo.jpg -Encoding byte)
Set-ADUser "username" -Replace @{thumbnailPhoto=$photo}
Subscribe to:
Posts (Atom)