| pid | 1081 |
|---|---|
| author | Peter |
| title | |
| date | 2009-05-06 04:02:02 -0700 |
| format | posh |
| parent | 0 |
Code generates a workable replacement for User Profile details web control on the person.aspx page in SharePoint (allows you to customize the resulting generated code)
[void]([reflection.assembly]::LoadWithPartialName("Microsoft.office.server"))
$serverContext = [Microsoft.Office.Server.ServerContext]::Default
$upm = [Microsoft.Office.Server.UserProfiles.UserProfileManager]$serverContext
@@ $upm.psbase.properties | ? { $_.isvisibleonviewer } | select DisplayName, name, displayorder, managedpropertyname | % { "<SPSWC:ProfilePropertyCheckValue PropertyNames=""$($_.Name)"" runat=""server"" Text=""<tr><td class="ms-profilelabel"gt;$($_.DisplayName): </td><td width="65%" valign="top">""/><SPSWC:ProfilePropertyValue PropertyName=""$($_.name)"" class=""ms-profilevalue"" runat=""server"" /><SPSWC:ProfilePropertyCheckValue PropertyNames=""$($_.Name)"" runat=""server"" Text=""</td></tr>""/>" } >a.txt; ii a.txt