Use WMI and Powershell to check and see if disk is Virtual, local or SAN

PS N:\> Get-WmiObject Win32_DiskDrive | % {
>>   $disk = $_
>>   $partitions = “ASSOCIATORS OF ” +
>>                 “{Win32_DiskDrive.DeviceID=’$($disk.DeviceID)’} ” +
>>                 “WHERE AssocClass = Win32_DiskDriveToDiskPartition”
>>   Get-WmiObject -Query $partitions | % {
>>     $partition = $_
>>     $drives = “ASSOCIATORS OF ” +
>>               “{Win32_DiskPartition.DeviceID=’$($partition.DeviceID)’} ” +
>>               “WHERE AssocClass = Win32_LogicalDiskToPartition”
>>     Get-WmiObject -Query $drives | % {
>>       New-Object -Type PSCustomObject -Property @{
>>         Disk        = $disk.DeviceID
>>         DiskSize    = $disk.Size
>>         DiskModel   = $disk.Model
>>         Partition   = $partition.Name
>>         RawSize     = $partition.Size
>>         DriveLetter = $_.DeviceID
>>         VolumeName  = $_.VolumeName
>>         Size        = $_.Size
>>         FreeSpace   = $_.FreeSpace
>>       }
>>     }
>>   }
>> }
>>

results

DiskSize    : 53694627840
RawSize     : 53560279040
FreeSpace   : 52996517888
Disk        : \\.\PHYSICALDRIVE7
DriveLetter : E:
DiskModel   : NETAPP LUN C-Mode  Multi-Path Disk Device
VolumeName  : Sys DB
Size        : 53560274944
Partition   : Disk #7, Partition #0

DiskSize    : 53686402560
RawSize     : 53552742400
FreeSpace   : 48738844672
Disk        : \\.\PHYSICALDRIVE1
DriveLetter : D:
DiskModel   : VMware Virtual disk SCSI Disk Device
VolumeName  : Bin
Size        : 53552738304
Partition   : Disk #1, Partition #0

via the Internet

Get top CPU processes via PowerShell and schedule collection via Windows Task Scheduler

PowerShell code

Get-WmiObject Win32_PerfFormattedData_PerfProc_Process | `
where-object{ $_.Name -ne "_Total" -and $_.Name -ne "Idle"} | `
Sort-Object PercentProcessorTime -Descending | `
select -First 5 | `
Format-Table Name,IDProcess,PercentProcessorTime -AutoSize

via the Geekery http://jon.netdork.net/2010/04/06/powershell-top-x-processes-using-cpu/

Task Scheduler

http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/11/weekend-scripter-use-the-windows-task-scheduler-to-run-a-windows-powershell-script.aspx

via The Scripting Guys

PowerShell management commands

$owners = @{}
gwmi win32_process |% {$owners[$_.handle] = $_.getowner().user}
get-process | sort vm | select processname, Id, @{l="Owner";e={$owners[$_.id.tostring()]}}

While(1) {ps | sort -des cpu | select -f 15 | ft -a; sleep 1; cls}

Get-Process | sort vm | select name, vm -Last 5

Get-WmiObject win32_processor | select LoadPercentage  |fl

Get-Counter '\Memory\Available MBytes'
Get-Counter '\Processor(_Total)\% Processor Time'