• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

List size of each web application into excel file

Dear All,

I need help to create an script to list from Sharepoint the size of each web application and send to csv file.


Thanks in advance,
0
Gonzalo Becerra
Asked:
Gonzalo Becerra
  • 4
  • 2
1 Solution
 
zaicnupagadiCommented:
Tell me what version of sharepoint do you have, and what version of powershell.
0
 
Gonzalo BecerraSharePoint - Technical Lead for Operations & Engineering Team - Superrvising AssociateAuthor Commented:
Windows 2008 R2 (Powershell V2)

Sharepoint 2010 SP1
0
 
jessc7Commented:
Try this:
Get-SPWebApplication | ForEach {$_.ContentDatabases} | Select WebApplication, Name, DiskSizeRequired, CurrentSiteCount | Export-csv test.csv

Open in new window

0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
Gonzalo BecerraSharePoint - Technical Lead for Operations & Engineering Team - Superrvising AssociateAuthor Commented:
jessc7 thanks, it's working perfect, how can I calculate the size in MB?

Thanks in advance,
0
 
Gonzalo BecerraSharePoint - Technical Lead for Operations & Engineering Team - Superrvising AssociateAuthor Commented:
I already discover how to convert to MB

I'm using the following script:
 
Get-SPWebApplication | ForEach {$_.ContentDatabases} | Select WebApplication, Name, @{Label ="Size in MB"; Expression = {$_.disksizerequired/1024/1024}}, CurrentSiteCount | Out-File gonza.txt

Open in new window


But I cannot see the complete name of the Web Application I see like this: SPWebApplication...

I would like to see the fullname of the Web Application
0
 
Gonzalo BecerraSharePoint - Technical Lead for Operations & Engineering Team - Superrvising AssociateAuthor Commented:
Thanks a lot for your help:

This is the final version of the script:

 
Get-SPWebApplication | ForEach {$_.ContentDatabases} | Select WebApplication, Name, @{Label ="Size in MB"; Expression = {$_.disksizerequired/1024/1024}}, CurrentSiteCount | Sort-Object "Size in MB" -Descending | Out-File WebAppSize.txt

Open in new window

0
 
jessc7Commented:
Thanks for the points, and thanks for posting your final solution!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now