Skip to content

Instantly share code, notes, and snippets.

@sub314xxl
Last active December 7, 2017 11:47
Show Gist options
  • Save sub314xxl/7362c987e4a3427953141eda2330d33a to your computer and use it in GitHub Desktop.
Save sub314xxl/7362c987e4a3427953141eda2330d33a to your computer and use it in GitHub Desktop.
#defrag
Optimize-Volume -DriveLetter C -CimSession ***pc_name*** -Defrag -Verbose
#set gerial number
get-ciminstance -classname win32_bios -computername ИМЯ_ПК | format-list serialnumber
#get print queue
Get-WMIObject -ComputerName Win32_PerfFormattedData_Spooler_PrintQueue | Select Name, @{Expression={$_.jobs};Label="CurrentJobs"}, TotalJobsPrinted, JobErrors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment