Maybe this can help someone. I found out that get-MailUser gives the external users in Office 365 and that the WhenChanged property changes when they login. This is not the case for the normal mailbox user. Then you need to get mail statistics to get the last login time.
I have made a small command that will calculate the date for a year ago and remove the Mail-user that has not been active in a year with no confirmation. I have this scheduled to run every month.
I get an error when i run this but the user is removed when i check:
An Azure Active Directory call was made to keep objectinsync between Azure Active Directory and Exchange Online.However,it failed.Detailed error message:Resource'XXXXX-053c-49a9-a7cc-XXXXXXXXXXXX'does not exist or one of its queried reference-propertyobjects are not present.
If you have tips for me to make this better then i appreciate this.
Viewing 0 reply threads
The topic ‘Office 365 remove Mail users (external users) not active for a year’ is closed to new replies.