Hello @Rajiv Kesavan ,
Thank you for Reaching out Microsoft Q&A.
I understand you want to get the Entra ID guest users Pending invitations and last login details using Powershell commands.
You can use the below PS commands to get the guest users Pending invitations:
For the last login details you can follow below and get the details:
Get-MgUser -All -Filter "UserType eq 'Guest'" -Property SignInActivity | Select-Object userprincipalname -ExpandProperty SignInActivity | Format-List
for additional details on last login you can follow: https://m365scripts.com/microsoft365/a-quick-approach-to-manage-guest-users-in-microsoft-365-using-powershell/#Check-Office-365-Guest-Users-Last-Logon-Time
https://www.michev.info/blog/post/2968/reporting-on-users-last-logged-in-date-in-office-365
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.
Regards,
Goutam Pratti.