Thursday 19 August 2021

Find the last logon timestamp of users in Azure AD using PowerShell

Find the last logon timestamp of users in Azure AD using PowerShell



 get-ADUser - filter {enabled -eq $true} -properties LastLogonTimeStamp | Select-object Name,@{Name="Stamp"; Expression={[DateTime] ::FrmFileTime($_.LastLogontimeStamp).Tostring('yyy-mm-dd_hh:mm:ss')}} | Export-csv -Path C:\Users\Ravanan\lastlogon.csv 




PS: check in Dev before running on Prod

 வாழ்க்கை முழுவதைம் அள்ளிச்சென்ற  பின்,   கனவில்  மட்டும்  வந்து   ஏன் இன்பம்  காட்டுகிறாய்... கனவு கலைந்ததும்  உண்மை  வாட்டுகிறது... கனவாவத...