daily pastebin goal
21%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
  2.  
  3. [Microsoft.SharePoint.SPSite] $site = Get-SPSite http://test/site
  4.  
  5. foreach ($web in $site.AllWebs)
  6. {
  7.     foreach ($list in $web.Lists)
  8.     {
  9.         if ($list.Fields.ContainsField("State"))
  10.         {
  11.             foreach ($item in $list.Items)
  12.             {
  13.                 if ($item["State"] -eq "Texas")
  14.                 {
  15.                     # Add this to a CSV, or Write-Host, or whatever
  16.                 }
  17.             }
  18.         }
  19.     }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top