Forum Discussion
Happyter
Aug 16, 2021Copper Contributor
Alert for New Added User
I can't find any resources/guide to create/enable/turn-on an alert for newly added users. Is there such a thing in Office 365 admin center?. I want to monitor newly added user on my domain, and revie...
- Aug 16, 2021Hello, you can use the "legacy" activity alerts https://compliance.microsoft.com/managealerts
pvanberlo
Aug 16, 2021MCT
There are no "out of the box" alerts around new user creation unfortunately. What you could do is leverage the Graph API and subscriptions to monitor user changes, or alternatively you can use the audit log to search for any activities for new user creation during a specific period. The latter would be a manual action, and the first would be complex to do unfortunately.
Happyter
Aug 16, 2021Copper Contributor
Thanks for your reply, I will be going with the manual action for now as I'm still new with the admin center.
- pvanberloAug 16, 2021MCT
Happyter Once you feel more comfortable with this, a simpler script and Graph API approach could be to use the Graph PowerShell module, the createdDateTime attribute of the user resource. This way you could script this, run the script in scheduled manner and get some kind of output.
Have a look at the Get-MgUser cmdlet. If you run it like:
$Date = (Get-Date).ToUniversalTime().AddMinutes(-15).ToString("yyyy-MM-ddTHH:mm:ssZ") $NewUsers = Get-MgUser -Filter "createdDateTime ge $Date" -ConsistencyLevel eventual -CountVariable ResultCount if ($ResultCount -gt 0) { $NewUsers }Would return a list of all users created in the past 15 minutes. You could extend this to take some action like send an email, and schedule the script to run regularly.