0

I am currently using the following script to pull a list of all my Office 365 groups.

Get-sposite -Limit All | Where {$_.Template -like "GROUP#0"} | Select URL,Title,StorageQuota,StorageUsageCurrent,Template,Status | Export-Csv C:\Support\Output\GroupSites-$date.csv -NoTypeInformation

I am trying to add creation date or last modified date to the report, could anyone assist me with what objects need to be added in the select options to get those?

2

First I'll answer your question, and then I'll teach you how to find these properties for your self.

Just add the LastContentModifiedDate to your list of properties

Get-sposite -Limit All | Where {$_.Template -like "GROUP#0"} | Select URL,Title,LastContentModifiedDate,StorageQuota,StorageUsageCurrent,Template,Status

Now, to find these properties for yourself, load your script in PowerShell ISE, loop through the results, and stick a breakpoint on the $_ iterator.

enter image description here

There does not seem to be a Created Date on the object so you'll have to live with this one. Also, be careful with modified dates on site objects. They might return false positives, for example a platform update might trigger a modified event.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.