Powershell - Get the server startup time

 www.orangeisland.cn

 

Use the following command, direct access to the server startup time:

 

 By following script, batch acquisition server startup time:

$TextPath = "C:\Users\admin\Desktop\serverlist.txt";
$TxtCon=Get-Content($TextPath)
foreach($LineCon in $TxtCon)
{
echo $LineCon
Get-WmiObject Win32_OperatingSystem -ComputerName $LineCon | FL CSName,LastBootUpTime,Name >>C:\Users\admin\Desktop\bootup_result.txt
}

 

Guess you like

Origin www.cnblogs.com/tiexuedanxin/p/Powershell-Get-server-boot-time.html