How to Retrieve Actual Email Addresses from Purview Audit Data?
Asked by
3d topography
I'm currently trying to work with some data from a Purview audit search. I'm using a PowerShell script to format the output, and it gives me a user identifier that looks like this: i:0h.f|membership|[email protected], where 'X' is a mix of characters. I'm wondering if there's a way to efficiently retrieve the actual email address of the user who shared the file. Is this something that's possible in PowerShell, or am I stepping into tricky privacy territory with M365 personal accounts? I know I could possibly access it through the SharePoint Admin by checking the user's OneDrive, but I want to avoid that to respect their privacy.
Answers
Just a heads-up, if that external email isn't set up as a guest user in your system, the command might not work as expected. So, make sure that the user is actually registered in your environment.
Reply to this answer
It seems you're dealing with a PUID/NetID, which is more of an internal identifier. To get the actual email address, you have a couple of options. You can either index all SharePoint profiles and pull their UserId using the SharePoint REST API, or you can try querying Exchange with a command like `Get-User -Filter "NetID -eq '100300009CBBxxx'"`.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions