Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: Unused Mailboxes #5984

Open
murati opened this issue Apr 18, 2024 · 6 comments
Open

New command: Unused Mailboxes #5984

murati opened this issue Apr 18, 2024 · 6 comments

Comments

@murati
Copy link

murati commented Apr 18, 2024

Usage

m365 outlook mail unused

Description

It retrieves the list of mailboxes which have no activity starting the given period

Options

Option Description
--period D7, D30, D90, D180
--since Starting date

Examples

Retrieve the list of inactive mailboxes in last 30 days

m365 outlook mail unused

Retrieve the list of active mailboxes starting the given date

m365 outlook mail unused --since 2024-01-01T00:00:000Z

Default properties

  • DisplayName
  • UserPrincipalName
  • LastActivityDate
  • IsArchived

Additional Info

No response

@waldekmastykarz
Copy link
Member

Thanks for the suggestion @murati! A couple of ideas:

  • what's the API that we could use to retrieve this information?
  • it seems like a report command, so I suggest that we rename it to m365 outlook report mailbox unused

@pnp/cli-for-microsoft-365-maintainers any other feedback before we open it up?

@waldekmastykarz waldekmastykarz added needs peer review Needs second pair of eyes to review the spec or PR feature request labels Apr 20, 2024
@milanholemans
Copy link
Contributor

I'm curious if there's an API for this. If there isn't, this should probably be converted to a sample script in my opinion.

@waldekmastykarz waldekmastykarz added needs research and removed needs peer review Needs second pair of eyes to review the spec or PR labels Apr 21, 2024
@murati
Copy link
Author

murati commented Apr 26, 2024

Per my research, it requires EXO V3. That was actually my question. Graph does not directly support EXO but when I read the source code, I saw some endpoints apart from graph usage. Therefore, I thought, you could reach EXO beyond my knowledge.

We are building a smart admin panel for M365 and the EXO requiring modules are the slowest ones. Please let me know, if I can contribute somehow and further.

@milanholemans
Copy link
Contributor

Can you provide some documentation about the API you want to leverage?

@murati
Copy link
Author

murati commented Apr 29, 2024

Can you provide some documentation about the API you want to leverage?

This is how I execute this command:

Get-EXOMailbox -InactiveMailboxOnly

And here is the link : https://learn.microsoft.com/en-us/powershell/module/exchange/get-exomailbox?view=exchange-ps

I wasn't able to find further API documentation about it.

@milanholemans
Copy link
Contributor

Let's see if we can get it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants