Are you running that PowerShell Get-Group from a machine in an on-premises Active Directory network? If you are, the information should be from your local AD, not the group in M365.
Whencreated date is incorrect
Hello,
I'm building a script that lists all office365 groups with their attributes so we can remove the unused ones. When i get the date of creation, whencreated gives me a completely incorrect date. I get the same result with get-group and get-unifiedgroup. Am i doing something wrong, or is this a bug i should submit?
Thank you
8 answers
Sort by: Most helpful
-
-
Richard Howse 6 Reputation points
2021-03-29T20:00:55.337+00:00 Yes the server is part on a on premise AD. I tried running the command from a computer not part of the AD, and i'm getting the same result.
-
Rich Matheisen 45,096 Reputation points
2021-03-29T20:08:39.393+00:00 Use the Exchange Online PowerShell V2 module to connect to Exchange Online PowerShell. Then use Get-UnifiedGroup, or Get-Group, as appropriate.
-
Richard Howse 6 Reputation points
2021-03-30T13:35:22.673+00:00 I tried the Exchange Online PowerShell V2 with Connect-ExchangeOnline rather than Connect-EXOPSSession i was using. Same result.
-
Richard Howse 6 Reputation points
2021-03-30T15:08:56.733+00:00 yes i tried:
$sfbSession = New-CsOnlineSession
Import-PSSession $sfbSessionSame result.