I want to be able to see the number, names, url of all site collections there are in a given farm. Would there be a powershell command to do that?
|
There should be a powershell equivalent of |
|||
|
If all you want is a list of all site collections in the farm, all you have to do is open a PowerShell window, load the SharePoint snapin if you haven't ( If you want to return the list of site collections for a specific web application, the easiest way is to just pipe it as If you want to grab additional information like boflynn suggested, you can also do this with a pipe; no need to script, or loop: You can also easily convert any PowerShell object or object array into XML using the Export-Clixml cmdlet. As an example, here's the previous command to get the ID and Url of all intranet web application sites, piped to an XML file: There's many output and conversion options; likewise, you also have the ability to output as a CSV using Export-Csv. Previous answers are not incorrect, but these are cleaner and shorter ways to do it. |
||||
|
|
|
If you copy your question title and past it into google search, the first link search result will contain a powershell script that describes how to collect site collections. But do not fogive to add |
|||
|
|
|
|||
|
|
|
Get-SPSite will return the site collections for you. If you want more details, you can loop through them for further processing:
|
|||
|