Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've further developed the code so that it now accepts a comma delimited list of properties and writes them to a delimited file.</p> <pre><code># Outputs a delimited file with specified user profile properties for each user in Sharepoint # Create array of desired properties $arProperties = 'UserName','FirstName','LastName','Title','WorkEmail','WorkPhone','Manager','AlternateContact','RoleDescription','PictureURL'; # Specify output file $outfile = 'UserProfiles.csv'; #Specify delimiter character (i.e. not one that might appear in your user profile data) $delim = '^'; # Specify Shared Service Provider that contains the user profiles. $SSP = "SharedServices"; [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles") # Function: Get-UserProfiles # Description: return a UserProfileManager object containing all user profiles # Parameters: SSPName SSPName # Function global:Get-UserProfiles($SSPName) { $ServerContext = [Microsoft.Office.Server.ServerContext]::GetContext($SSPName); $UPManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServerContext); return $UPManager.GetEnumerator(); } $profiles = Get-UserProfiles($SSP); #Initialise Output file with headings $header = [string]::join($delim,$arProperties); Write-Output $header | Out-File $outfile #Output the specified properties for each $profiles | ForEach-Object { foreach($p in $arProperties){ # Get the property name and add it to a new array, which will be used to construct the result string $arProfileProps += $_.Item($p); } $results = [string]::join($delim,$arProfileProps); # Get rid of any newlines that may be in there. $CleanResults = $results.Replace("`n",''); Write-Output $CleanResults Remove-Variable -Name arProfileProps } | Out-File -Append $outfile </code></pre> <p>This gets me a bit closer. I'd still really like a script that iterates through all the profile properties and puts them into a CSV or XML file more gracefully. This will do for now.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload