How to get Sharepoint site details using Powershell in Office 365?

Hello SharePointers,

Below are the powershell code to site title, url, last modified date and creation date for a given sharepoint site collection.

Get-SPWebApplication | Get-SPSite -Limit ALL | Get-SPWeb -Limit ALL |
  where { $_.HasUniquePerm -and $_.AssociatedOwnerGroup -ne $null } | 
  foreach { $Title=$_.title;$TTNweburl = $_.Url; $_ ;$SiteCreatedDate=$_.Created; $SiteModifiedDate=$_.LastItemModifiedDate}| 
  Select -ExpandProperty AssociatedOwnerGroup | 
  Select -ExpandProperty Users |
  Select {$Title},{$TTNweburl}, UserLogin, DisplayName, $SiteCreatedDate.ToShortDateString(), $SiteModifiedDateToShortDateString()
  Export-Csv -Path  D:\ExportDetails.csv -Force

Happy SharePointing 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *