Title: Get The Quicklinks for all users  from UserProfile



  1. #Add SharePoint PowerShell SnapIn if not already added   
  2.     if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {   
  3.         Add-PSSnapin "Microsoft.SharePoint.PowerShell"   
  4.     }   
  5.   
  6.   
  7.   
  8. $context = Get-SPServiceContext -Site http://people.in.lakku.com.au  
  9. $upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)  
  10.   
  11.  $AllProfiles = $upm.GetEnumerator()   
  12.   
  13. #$profile = $upm.GetUserProfile("domainname\id")  
  14.   
  15.   
  16. $date = Get-Date -format MMddyyy   
  17. $OutPutFilename="F:\LB\Links.csv"; #test purose in my PC  
  18.   
  19. "Site URL" + "," +"Last ModifiedBy"",""Last Modified Date" | Out-File -Encoding Default -FilePath $OutPutFilename;  
  20.   
  21.   
  22.   
  23. foreach($profile in $AllProfiles)    
  24.     {    
  25.         $qlm = $profile.QuickLinks  
  26.           
  27.               foreach($link in $qlm.GetItems())  
  28.                  {   
  29.   
  30. $AccountName = $profile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::AccountName].Value    
  31.  
  32.                      # write-host $link.Group $link.Url   
  33.                         
  34.                        $AccountName + "," + $link.Group +"," +$link.Url| Out-File -Encoding Default  -Append  -FilePath $OutPutFilename;  
  35.   
  36.              
  37.                       }   
  38.   
  39.    }