Forum Discussion

pardeep soba's avatar
pardeep soba
Copper Contributor
Aug 16, 2017
Solved

need a script with last logon date or time for cloud users

Hi

 

i need to check when cloud users last logged on so i can do some housekeeping. These are cloud account so can not user exchange reports i have seen only for this

 

I have created this script but just need to get the out also of last logon time or date

 

get-msoluser -UserPrincipalName "Barnaby.Smither@centricaplc.onmicrosoft.com" | select FirstName, LastName, DisplayName, UserPrincipalName, UsageLocation, Department, Fax, WhenCreated -ExpandProperty Licenses |
Select FirstName, LastName, DisplayName, UserPrincipalName, UsageLocation, Department, AccountSkuID, Fax, WhenCreated

Resources