Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
- [Microsoft.SharePoint.SPSite] $site = Get-SPSite http://test/site
- foreach ($web in $site.AllWebs)
- {
- foreach ($list in $web.Lists)
- {
- if ($list.Fields.ContainsField("State"))
- {
- foreach ($item in $list.Items)
- {
- if ($item["State"] -eq "Texas")
- {
- # Add this to a CSV, or Write-Host, or whatever
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment