Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. ###
  2. # Danny Davis
  3. # twitter: twitter.com/pko3
  4. # github: github.com/pkothree
  5. # Created: 4/25/17
  6. # Modified: 4/25/17
  7. # Description: Get all Site Collections that are using InfoPath Form in any form
  8. ###
  9.  
  10. # Vars
  11. $webApp = "WEBAPP"
  12.  
  13. if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
  14. {
  15. Add-PSSnapin Microsoft.SharePoint.PowerShell
  16. }
  17.  
  18. $w = Get-SPWebApplication $webApp
  19. $webAppName = $w.Name
  20.  
  21. start-transcript -path $webAppName"_SCWithInfoPath.txt"
  22.  
  23. # Get All SiteCollections
  24. $sites = Get-SPSite -WebApplication $webApp -Limit All
  25.  
  26. Write-Host "Site-URL;Owner;List-URL" "`r"
  27.  
  28. # Iterate through each SiteCollections
  29. foreach($site in $sites)
  30. {
  31. $web = Get-SPWeb $site.URL
  32. foreach($list in $web.Lists)
  33. {
  34. if($list.BaseType -eq "DocumentLibrary" -and $list.BaseTemplate -eq "XMLForm")
  35. {
  36. Write-Host $site.Url ";" $site.Owner ";" $list.Rootfolder.URL "`r" -ForegroundColor "Green"
  37. }
  38. elseif ($list.ContentTypes[0].ResourceFolder.Properties["_ipfs_infopathenabled"])
  39. {
  40. Write-Host $site.Url ";" $site.Owner ";" $list.Rootfolder.URL "`r" -ForegroundColor "Green"
  41. }
  42. }
  43. }
  44.  
  45. $site.Dispose()
  46.  
  47. Stop-Transcript
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement