Domanda

Is there another way to push data from Active Directory to profile DB without using UPS. i am working on developer machine and just need one time push from AD to profile DB. Is there an alternate to UPS. The UPS thing on SP2010 RTM is a mess.

È stato utile?

Soluzione

You could create user profiles programmatically using UserProfileManager.CreateUserProfile method.

You can leverage this method either by using Console Application, or by creating a PowerShell script. I'd prefer the latter approach.

PowerShell code for creating one profile would look something like this:

$serviceContext = Get-SPServiceContext http://localhost
$manager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext)

$profile = $manager.CreateUserProfile("domain\helloworld")
$profile.DisplayName = "Hello World"
$profile.Commit()

Actually, I've even found a post where a similar script is already implemented:

This solution will allow you to add user profiles from an XML file. However, obviously it is also possible to pull them from AD.

P.S. I haven't tried this particular script, but recently I used a PowerShell script to populate Organization profiles, and all worked fine.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top