How to get computer uptime using PowerShell and ADAudit Plus
Written by Lakshmi, IT security team, ManageEngine Updated on November 2025
A computer's uptime gives you the information on how long the computer has been operational. Uptime management is taken care of by an organization's information system officers to control, monitor, and optimize operational productivity.
This article compares the methods of obtaining a computer's uptime report with Windows PowerShell and ManageEngine ADAudit Plus, a comprehensive real-time Active Directory auditing tool.
Windows PowerShell
Steps to obtain a computer's uptime using PowerShell:
- Identify the domain from which you want to retrieve the report.
- Identify the LDAP attributes you need to fetch the report.
- Identify the primary DC to retrieve the report.
- Compile the script.
- Execute it in Windows PowerShell.
- The report will be exported in the given format.
- To obtain the report in a different format, modify the script accordingly.
Sample Windows PowerShell Script:
Get-Uptime [-ComputerName [] [[-Credential] ]
ADAudit Plus
To obtain the report,
- Login to ADAudit Plus web console as an administrator.
- Navigate to the Reports tab and from the Local Logon-Logoff section in the left pane, select Computer Startup and Shutdown report. The Active Hrs column in the report shows every computer's uptime.
- Select the domain and click Generate.
- Select Export As to export the report in any of the preferred formats (CSV, PDF, HTML, CSVDE and XLSX).
Following are the limitations to obtain a report of computers' uptime using native tools like Windows PowerShell:
- The script can be executed only from the computers which has Active Directory Domain Services role.
- It's difficult to change date formats, and apply different time zones on the date results.
- It is difficult to export the report in file formats other than CSV.
- Applying more filters like OU or 'User name starts with' will increase the LDAP query complexity.
ADAudit Plus will generate the computer uptime report in a simple and intuitively designed UI.