question

RichardHowse-3657 avatar image
0 Votes"
RichardHowse-3657 asked RichardHowse-3657 answered

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



82409-powershell1.png
82455-powershell2jpg.jpg


windows-server-powershell
powershell1.png (181.6 KiB)
powershell2jpg.jpg (59.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichardHowse-3657 avatar image
0 Votes"
RichardHowse-3657 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered

Use the Exchange Online PowerShell V2 module to connect to Exchange Online PowerShell. Then use Get-UnifiedGroup, or Get-Group, as appropriate.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichardHowse-3657 avatar image
0 Votes"
RichardHowse-3657 answered RichMatheisen-8856 commented

I tried the Exchange Online PowerShell V2 with Connect-ExchangeOnline rather than Connect-EXOPSSession i was using. Same result.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Have you imported that session?

0 Votes 0 ·
RichardHowse-3657 avatar image
0 Votes"
RichardHowse-3657 answered

yes i tried:

$sfbSession = New-CsOnlineSession
Import-PSSession $sfbSession

Same result.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.