Question : Powershell script that will get Directory Sizes and email them to the Administrator

I would like to get help with a powershell script that gives me the size in MB or GB of a location on my E drive (Where my exchange logs are located) - which creates a text file and then that file gets emailed to an email address.

I have attached what I have thus far - in regards to getting file size - but I dont know where to change it to specify a certain location.

Also does the script have to be run from where it needs to pull the information?

Anyways I have gotten a little further - see my attached code - now my problem is that the output now says "WARNING: 2 columns do not fit into the display and were removed."
Code Snippet:
1:
Dir e:\Exchange *.* -rec | sort length -desc | select name,directory, @{name="Size in GB";Expression={[System.Math]::Round($_.length/1073741824,1)}},CreationTime -First 10 | ft -auto > C:\Largefiles.txt
Open in New Window Select All

Answer : Powershell script that will get Directory Sizes and email them to the Administrator

Try This
1:
Dir e:\Exchange *.* -rec | sort length -desc | select name,directory, @{name="Size in GB";Expression={[System.Math]::Round($_.length/1073741824,1)}},CreationTime -First 10 | ft -auto -width 500 > C:\Largefiles.txt
Open in New Window Select All
Random Solutions  
 
programming4us programming4us