1

I want to extract info regarding Username and Replacements from the users profile properties for all users and have it written to a csv file.

Maybee through a powershell script so it can run in a scheduled task.

Being new to Powershell and SharePoint, I need some assistance!

I am using SharePoint 2010.

5
  • What exactly do you mean with replacements? Commented Oct 22, 2012 at 8:18
  • Hi anders In mysite under More information, we have 2 lines where you can add the name of your replacements (Not sure if this is default or if it is custom made for us). our users maintain this themself, and i would like to create a list where our users quickly can see who is replaceing who...
    – Kenneth
    Commented Oct 22, 2012 at 10:08
  • With "my site" do you mean your public profile (eg. <yourmysite>/person.aspx)? Could you supply a screenshot of this? Commented Oct 22, 2012 at 11:01
  • Hi anders yes it´s mysite/person.aspx - sorry cannot find where to add files :-) in there you have the option to add replacements br K
    – Kenneth
    Commented Oct 22, 2012 at 14:04
  • you should be able to add images from the toolbar meta.stackexchange.com/questions/75491/… I dont see the replacement stuff on my public profile Commented Oct 22, 2012 at 14:16

2 Answers 2

1

Assuming you want this information consumed by some other application, you could just use a SQL view to grab the information you want: http://iedaddy.com/2012/03/sharepoint-2010sql-view-to-get-user-profile-property-bag-values/

Or if you're looking to use the timer to export the CSV for audit historical purposes here's a post from when I had to read a CSV into the UPS, obviously just reverse the process: http://iedaddy.com/2010/06/sharepoint-2010-updating-user-profile-properties-with-powershell/

Of course, if your using a timer job to kick off the process make sure you set your context to the mysite web app to grab an instance of the UPS.

0

In this post: http://salvatoredifaziosharepoint.blogspot.it/2012/06/powershell-get-list-of-users-that-use.html I wrote a powershell script to get the users of my farm and print a custom property. You can use it and expand it to wrote the information in a CSV file.

Meanwhile this is the code of the post:

$url = "http://mysharepointsite/"
$site = Get-SPSite $url
$context = Get-SPServiceContext $site
$pMgr = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
$enum = $pMgr.GetEnumerator()

while ($enum.MoveNext()) {
  $currUser = $profiles.Current
  $name = $currUser.DisplayName
  $customProp = $currUser["MyCustomProperty"]
  Write-Host "$name;$customProp"
}
1
  • 1
    Referring to external blog posts is fine, but please also include a short description on what is there and how it works. External links tend to be more short-lived than our forum, and we want to keep as much info inside this site as possible. Commented Oct 22, 2012 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.