Forum Discussion
TherealKillerbe
Mar 29, 2024Brass Contributor
Cleanup stale guests
Hi, we have Entra ID p2 licenses, however cannot select the option "Inactive Users (On Tenant Level) only" in the access review. Wherefore i cannot specify the timeframe after which guests account ar...
- Mar 30, 2024For those who do not know, this feature was recently moved from Entra P2 to require an add-on license called "Microsoft Entra ID Governance." Reference: https://learn.microsoft.com/en-us/entra/identity/users/clean-up-stale-guest-accounts#license-requirements
TherealKillerbe
Mar 29, 2024Brass Contributor
I managed to have the script running via a runbook (import-module Microsoft.Graph.Authentication), but have the same result as with the single managed service account. I have used write-output to see what is going on in the script and i can see that it is retrieving the Guests account as expected.
29/3/2024 15:55:01
Output
Retrived 317 guest accounts which did not accept their invitation
29/3/2024 15:55:02
Output
retrieved 302 guest accounts which have not accepted the invitation in the last 90 days
Looking at the output, i sort of getting a idea why the final report says:
Summary
Entra ID contained 0 guest accounts, of which 0 and 0 have been deducted.
Which brings the remaining Guest accounts to 0.
I use two registered apps, one to perform the operations and one to send email notifications. Wherefore i am guessing that it creates two sessions, and variable are not available in the second session wherefore the Object counts are 0.
29/3/2024 15:55:01
Output
Retrived 317 guest accounts which did not accept their invitation
29/3/2024 15:55:02
Output
retrieved 302 guest accounts which have not accepted the invitation in the last 90 days
Looking at the output, i sort of getting a idea why the final report says:
Summary
Entra ID contained 0 guest accounts, of which 0 and 0 have been deducted.
Which brings the remaining Guest accounts to 0.
I use two registered apps, one to perform the operations and one to send email notifications. Wherefore i am guessing that it creates two sessions, and variable are not available in the second session wherefore the Object counts are 0.