www.orangeisland.cn
使用以下命令,直接获取服务器启动时间:
通过以下脚本,批量获取服务器的启动时间:
$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
}