Domain Controller - last restart date script

  • 17 Views
  • Last Post 05 August 2015
anandh11.v posted this 05 August 2015

Hi,
I'm trying write power shell script to identify the DC's that weren't restarted for the last 30days.
I'm trying to schedule it to run everyday night and generate a report which needs saved in sharepoint and the same needs to be sent over administrators via email
Any suggestions 
ThanksA

Ravi.Sabharanjak posted this 05 August 2015

Found this on stack overflow or elsewhere on the web -
function Get-SystemUptime           
{           
    $operatingSystem = Get-WmiObject Win32_OperatingSystem               
    [Management.ManagementDateTimeConverter]::ToDateTime($operatingSystem.LastBootUpTime)           
}
You will need to modify it to take the computer name as a parameter etc. .Not sure about the sharepoint aspect.
Another option is to set SCCM to inventory every day, and then write a report to report on the uptime. I believe that is collected into the database. It should be possible to embed this into sharepoint.
This is a great post on how to create custom reports for SCCM:



http://exar.ch/creating-a-custom-sccm-report/


show

Close