Here is the small issue i faced and found the solution after 4 hours struggle.
Scenario : I came accross a requirement create a powershell script to get the site usage in MB for all the site collections in a web application.
Below is the code to get the same :
$usage = $spSite.usage.storage/1MB
Issues : when i ran the above script most of the site collections the it is returning null / zero. When i check the same using STSADM enumsites command it is again diffarent.
Solution : Log off from the server re login as farm administrator account.
Conclusion : Farm administrator who has full control on all the SQL, SharePoint can only be allowed to pull the information.
Scenario : I came accross a requirement create a powershell script to get the site usage in MB for all the site collections in a web application.
Below is the code to get the same :
$usage = $spSite.usage.storage/1MB
Issues : when i ran the above script most of the site collections the it is returning null / zero. When i check the same using STSADM enumsites command it is again diffarent.
Solution : Log off from the server re login as farm administrator account.
Conclusion : Farm administrator who has full control on all the SQL, SharePoint can only be allowed to pull the information.