Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need a powershell script that does - Use powershell to get the processes running

ID: 3795187 • Letter: N

Question

Need a powershell script that does - Use powershell to get the processes running on server save them to a variable and get the following properties ProcessName, Id, PagedSystemMemorySize, CPU, SessionID, VirtualMemorySize
Write your powershell script here:

Explanation / Answer

###################################################################################### SECTION::Processe=>Top Memory #Get Wmi Information into Array $objTopProcessMem = Get-Process | Sort-Object WorkingSet -Descending | select -First 10 #Set the Table and first header $objHTML+= "" $objHTML+= "
" $objHTML+= "" $objHTML+= " Top 10 Processes by Memory " $objHTML+= "" #Set Headers $objHTML+= "" $objHTML+= " ProcessName " $objHTML+= " SessionId " $objHTML+= " WorkingSet " $objHTML+= " VirtualMemorySize " $objHTML+= " PagedMemorySize " $objHTML+= " PrivateMemorySize " $objHTML+= " PagedSystemMemorySize " $objHTML+= " NonpagedSystemMemorySize " #Loop for each item in Array Foreach ( $objProc in $objTopProcessMem) { $objHTML+= "" $objHTML+= "" + $objProc.ProcessName + "" $objHTML+= "" + $objProc.SessionId + "" $objHTML+= "" + [math]::Round($objProc.WorkingSet64/1024/1024,2) + "MB" $objHTML+= "" + [math]::Round($objProc.VirtualMemorySize64/1024/1024,2) + "MB" $objHTML+= "" + [math]::Round($objProc.PagedMemorySize/1024/1024,2) + "MB" $objHTML+= "" + [math]::Round($objProc.PrivateMemorySize/1024/1024,2) + "MB" $objHTML+= "" + [math]::Round($objProc.PagedSystemMemorySize/1024/1024,2) + "MB" $objHTML+= "" + [math]::Round($objProc.NonpagedSystemMemorySize/1024/1024,2)+ "MB" $objHTML+= "" } $objHTML+= "" #END Process Information -> Memory
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote