Advertisement
Guest User

Falak

a guest
Mar 5th, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function GetAllFields($url)
  2. {
  3.     $sites = Get-SPSite $url
  4.  
  5.     foreach ($web in $sites.AllWebs)
  6.     {
  7.         $lists = $web.Lists
  8.  
  9.         foreach ($list in $lists)
  10.         {
  11.             if ($list.Title -like "*Formatbibliotek*")
  12.             {
  13.                
  14.                     Write-Host $web.Name -ForegroundColor Green
  15.                     Write-Host "  " $list.Title -ForegroundColor Cyan
  16.  
  17.                     foreach ($item in $list.Items)
  18.                     {
  19.                         Write-Host "    " $item.Name
  20.  
  21.                         $file = $item.File
  22.  
  23.                         foreach ($key in $file.Properties.Keys)
  24.                         {
  25.                             Write-Host "      " $key -ForegroundColor Yellow -NoNewline
  26.                             Write-Host "      " $file.Properties[$key] -ForegroundColor White
  27.                         }
  28.                     }
  29.                
  30.             }
  31.         }
  32.     }
  33.  
  34.     If ($sites -ne $null)
  35.     {
  36.         $sites.Dispose();
  37.     }
  38.  
  39.     If ($web -ne $null)
  40.     {
  41.         $web.Dispose();
  42.     }
  43.  
  44. }
  45.  
  46. GetAllFields http://skvkfm-100-1:9899/sites/sitedirectory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement