Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $strComputer = "."
  2.  
  3. $colItems = get-wmiobject -class "Win32_DiskQuota" -namespace "root\CIMV2" `
  4. -computername $strComputer
  5.  
  6. foreach ($objItem in $colItems) {
  7.     [int]$diskSpaceUsedMB = [Math]::Round($objItem.DiskSpaceUsed / 2048)
  8.  
  9.     write-host "User: " $objItem.User
  10.     write-host "Disk Space Used: " $diskSpaceUsedMB
  11.     write-host
  12. }
  13.  
  14. Read-Host "Press any key to continue...."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement