Question : Script to export server partition sizes

Good afternoon,
I was wondering if anyone could help me create a script.  The script would need to scan AD for server type OS's, then use WMI to connect to each server and export the partition size and free space for each server in AD to a CSV file.
The output would look like the following:
Server-Name,partition1,total-size in GB,free-space in GB
Server-Name,partition2,total-size in GB,free-space in GB

For Example:
server1,C,100,50
server1,D,100,25
server2,C,12,2
server2,D,50,10

I figured I would need help with this script so i am opening this question while Im working on the script. I will post revisions as I create them.

Answer : Script to export server partition sizes

Open Exchange 2007 management shell (CMD line) and type following commands:

Get-PublicFolder -server xxxxx "\" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -server xxxxx
-Recurse -ErrorActionilentlyContinue

Get-PublicFolder -Server xxxxx "\Non_Ipm_Subtree" -Recurse -ResultSize:Unlimited | Remove-PublicFolder
-Server xxxxx -Recurse -ErrorActionilentlyContinue

 

Replace xxxxx with your Exchange server name in the above command.

 

in ADSIEdit, go to Configuration, Configuration, Services, Microsoft Exchange, First

Organization, Administrative Groups, Exchange Administrative Group, Servers, Servername, Information Store, First Storage

Group.  Then on the right hand pane, highlight the Public Folder Store and Delete it.  This performs basically the

same function as the cmdlet does, or removing it via the Exchange Management Console
Random Solutions  
 
programming4us programming4us