Showing posts with label powershell cmdlets. Show all posts
Showing posts with label powershell cmdlets. Show all posts

Thursday, 4 October 2012

Trick and Tip: How to get list of site collections details in each content databasse in SharePoint using PowerShell


Here another powershell cmdlet to know list of site collections details in each content database using powershell cmdlets

for this i used the following powershell cmdlet

Get-SPContentDatabase | %{Write-Output "ContentDB is - $($_.Name)"{sites are}; foreach($site in $_.sites) {write-Output $site.url}{"-----"}}


and output will look like this


Trick and Tip: How to know associated content databases to each web application in SharePoint using powershell


Here one small cmdlet to know content databases details for each web application in my SharePoint.
For this am going to use the following powershell cmdlet
"Get-SPWebApplication | %{Write-Output "`n- $($_.url)"; foreach($cd in $_.contentdatabases){Write-Output $cd.name}} "
and OutPut is like this