铁血丹心的博客

Keep moving...

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 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
}

 

posted on 2019-06-03 09:20  Michael_Cheung  阅读(862)  评论(0编辑  收藏  举报