Lansweeper last logon report
The below script helps the LastLogon property to convert to date fourth command uses the Export-CSV cmdlet to export a list of adcomputer last logon in the CSV file. LastLogon property contains a value in number format that needs to be converted to date timestamp.
![lansweeper last logon report lansweeper last logon report](https://www.asiancook.eu/images/logonlAISA.png)
Third command select name, ad computer lastlogon, and lastlogondate. Second command sort computer object by last logon and pass output to the third command. Properties * – gets all the properties of the adcomputer object and passes the output to the second command. Get-ADComputer cmdlet gets all the ad computers in active directory using Filter * To get last logon date for computers in the active directory and export the adcomputer last logon details to CSV file, run the below command Get-ADComputer -Filter * -Properties * | Sort LastLogon | Select Name, | Export-Csv C:\adcomputers-last-logon.csv -NoTypeInformation Let’s understand with an example to Get-ADComputer last logon in active directory.ģ Conclusion Get-ADComputer Last Logon in Active Directory Quick to summarize about PowerShell Get-ADComputer syntax which we will be using in our command to get adcomputer last logon Get-ADComputer We will use PowerShell Get-ADComputer cmdlet to get computer object and active directory computer last logon and last logon computer in OU.
LANSWEEPER LAST LOGON REPORT HOW TO
In this article, I will explain how to use Get-ADComputer to find the last logon date for the computer in the active directory using PowerShell.
![lansweeper last logon report lansweeper last logon report](https://content.spiceworksstatic.com/service.community/p/how_to_step_attachments/0000096340/5506b608/attached_file/996498e0237b318b0deb96b27f3fffa97853ef7af00a2104e735247c7eabf3e1_post-1-0-06531900-1397499668_1_.png)
Get-ADComputer last logon date-time helps to understand when was the last time computer used. In a large organization, the System administrator has to continuously monitor inactive or stale objects in Active Directory. Active Directory Get-ADComputer cmdlet gets one or more computers in the active directory.