I have created a Power Shell Script for Office 365 groups to export certain data we are looking for.
the part I’m stuck on is when I use Write-Host that creates a variable, this displays correctly, so I know it’s getting the data:
enter code here`Write-Host "Newest Inbox Traffic:" $CheckDate = (Get-MailboxFolderStatistics -Identity $Group.Alias -IncludeOldestAndNewestItems -FolderScope Inbox).NewestItemReceivedDate -ForegroundColor White
Now when I create the export to Excel, I’m selecting fields in the order I want them to appear in the table but how do I add the variable:
```Get-UnifiedGroup -Identity $Group.Id | Select DisplayName,AccessType,WhenCreated,WhenChanged,$CheckDate,GroupMemberCount,GroupExternalMemberCount,IsMembershipDynamic | Export-CSV $CSVPath2 -NoTypeInformation -Append```
Ideally, I would also like to label the variable in excel so it doesn’t show in the title column as $CheckDate