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,
LVL 1
Gonzalo BecerraSharePoint - Technical Lead for Operations & Engineering Team - Superrvising AssociateAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Challenges in Government Cyber Security

Has cyber security been a challenge in your government organization? Are you looking to improve your government's network security? Learn more about how to improve your government organization's security by viewing our on-demand webinar!

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.