I wanted to start a blog for a long time and I was thinking about it and planning about it except taking the action. Now I’m taking the action. Still figuring out this WordPress.. let’s see if I can simply add a simply add a PowerShell Script here
Function Get-RebootTime
{
Param([string]$name)
Get-CimInstance -ClassName win32_Operatingsystem -computername $name | select csname,lastbootuptime
}
$servers = Get-Content C:\temp\Servers.txt
foreach($server in $servers)
{
Write-output "Reboot time of $server :"
Get-RebootTime -name $server
}
Write-output "Checking the patches on $server"
Get-hotfix -Computername $server