Len Kally
asked on
Powershell Disk space on all folders on drive
Does anyone have a script that works in powershell Windows Server 2008 R2, that gives me the folder space on 2 drives.
I need the folder size: Total size of folder, remaining size of folder.
All folders on a particular drive.
I tried some scripts but either they did not work, or did not give me what I needed.
I know very little about powershell.
Thanks
I need the folder size: Total size of folder, remaining size of folder.
All folders on a particular drive.
I tried some scripts but either they did not work, or did not give me what I needed.
I know very little about powershell.
Thanks
ASKER
No quotas involved.
I just want the disk space taken and remaining on the folders on the root C:\ or E:\, what your telling me is this is impossible?
I just want the disk space taken and remaining on the folders on the root C:\ or E:\, what your telling me is this is impossible?
The remaining space is reflected as free space on the drive not on the individual folders.
You can see the aggregate space consumed on the drive, or go through getting the space consumed on each folder.
https://technet.microsoft.com/en-us/library/ff730945.aspx
powershell has access to the wmi interface as well
http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/08/use-powershell-to-create-a-report-displaying-free-disk-space.aspx
You can see the aggregate space consumed on the drive, or go through getting the space consumed on each folder.
https://technet.microsoft.com/en-us/library/ff730945.aspx
powershell has access to the wmi interface as well
http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/08/use-powershell-to-create-a-report-displaying-free-disk-space.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
from the command can you have the output to GB or KB?
It does what I want but want the space in KB, or GB
Thanks
It does what I want but want the space in KB, or GB
Thanks
Your question seems to suggest you use file share resource handler that sets a quota for a folder and you are looking for powershell mechanism that will report that info while running locally.
Presumably the scripts you've seen deal with reporting the folder sizes as you want, using a list with your set limits on the various folders will let the script you have seen to calculate the remaining space for those folders.