Support
 
Phone Get Quote
 
Support
 
US: +1 888 720 9500
US: +1 888 791 1189
Intl: +1 925 924 9500
Aus: +1 800 631 268
UK: 0800 028 6590
CN: +86 400 660 8680

Direct Inward Dialing: +1 408 916 9892

How to get computer uptime using PowerShell and ADAudit Plus

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).
    how-to-get-computer-uptime-using-powershell

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.

  • Avoid complex PowerShell-scripting, and simplify AD change auditing with ADAudit Plus.
  • Avoid complex PowerShell-scripting, and simplify AD change auditing with ADAudit Plus.
  •  
  • By clicking 'Get Your Free Trial', you agree to processing of personal data according to the Privacy Policy.
  •  
  • Thanks!
  • Your download is in progress and it will be completed in just a few seconds! If you face any issues, download manually here.

Related Resources

ADAudit Plus Trusted By