Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $i=1
- $raportuj='t'
- $br = "<br><br>"
- $command = 'cat /proc/meminfo | grep Available'
- while($i -lt 11)
- {
- $compid = "<h2>Raport dotyczący systemów nr " + $i + "</h2><br><br>"
- $cpuid = "AD CPU"
- $cpuinfo = Get-CimInstance -Computername kontroler -Class CIM_Processor -ErrorAction Stop | Select-Object LoadPercentage
- $cpu = $cpuid + " " + $cpuinfo
- $services = Get-Service -Computername kontroler | Select ServiceName, Status | ConvertTo-HTML
- $userid = "User wykonywujący skrypt: "
- $userinfo = $env:UserName
- $user = $userid + $userinfo
- $ramid = "Windows RAM: "
- $raminfo = Get-CimInstance -Computername kontroler -Class Win32_OperatingSystem | Select FreePhysicalMemory
- $ram = $ramid + " " + $raminfo
- $compid,$cpu,$br,$ktoWykonuje, $user,$br,$ram,$br,$ramLinux,$br,$services | Out-File -FilePath C:\inetpub\wwwroot\Raport$i.html
- Copy-Item -Path C:\inetpub\wwwroot\Raport$i.html -Destination 'C:\inetpub\wwwroot\' -ToSession (New-PSSession -ComputerName wscore)
- $i++
- if($i -eq 11)
- {
- Write-Host 'Powtorzyc? (t/n)'
- $raportuj = Read-Host
- if($raportuj -eq 't')
- {
- $i=1;
- }
- }
- sleep 10
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement