Snippets Collections
$counters = “\ServerNameProcessor(_Total)% Processor Time”, “\ServerNameMemoryAvailable MBytes”, “\ServerNameLogicalDisk(C:)% Free Space” $interval = 5 $duration = (New–TimeSpan –Minutes 30) $path = “C:PerformanceData.csv” $samples = $duration.TotalSeconds / $interval $data = @() for ($i=1; $i –le $samples; $i++) { $sample = Get–Counter –Counter $counters –SampleInterval $interval $data += $sample.CounterSamples | Select–Object –Property Timestamp, Path, CookedValue } $data | Export–Csv –Path $path –NoTypeInformation
star

Sun Apr 06 2025 12:31:43 GMT+0000 (Coordinated Universal Time) https://rootguide.co.za/2023/01/27/powershell-scripts-for-automating-windows-server-management/

#powershell #activedirectory #windowserver #wsus

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension