Friday 20 January 2017

Find the size of your Farm, Web application, Site collection or the site

Today I am providing the Power Shell Script that is useful to show or get the size of each and every site and site collection as per user input and requirement.

Inputs
Other inputs - Script will ask different input on the basis of user choice. Please follow the instructions

Outputs
At the end of the script user will get the size of all sites/Site collection/web application/Farm.

Example-
To show result in power shell screen
.\scriptname.ps1
 to get output in a file
.\scriptname.ps1 | out-file “FilePath\Filename.txt”

Dependencies –
Run this script with Farm Account. Farm account is the user who installed SharePoint.
User should be Site collection administrator in all the sites.
User should have Shell Admin rights to run the scripts.
Run Management Shell as an Administrator. 
How to execute -
Copy this script and paste in Note pad.
Save this file as .ps1.
Run this script in SharePoint Management Shell. You can run this script in PowerShell as well after adding SharePoint snapin (Add-pssnapin *.sharepoint.*).
Follow on screen instructions.

FOR ANY HELP ON THIS SCRIPT USE "GET-HELP .\SCRIPTNAME.PS1 --FULL" AFTER SAVING THIS FILE.
https://drive.google.com/file/d/0BznVpoE_ln0AamFkQ0g2VlVYY00/view?usp=sharing

Saturday 14 January 2017

Upload files to SharePoint from a Client Machine


Today I am providing the Power Shell Script that is useful to upload all the files from a given folder to a given library from a client machine. This script does not need any power shell management shell or power shell remoting.

Inputs-
Destination Library - Enter the web url of the library where you want to upload files.
File path - Path the folder where the files are kept for uploading. All files in this folder will be uploaded in SharePoint library.
Credentials - as we are connecting to SharePoint we will need to provide credentials to upload files to library. User should have Contribute access to library and Read access to site.

Outputs-
All the files of given folder will be uploaded in the given library.

Example-
.\scriptname.ps1
.\scriptname.ps1 | out-file “FilePath\Filename.txt”

Dependencies –
For executing this script user must have read access on the site and contribute access on the Library.

How to execute -
Copy this script and paste in Note pad.
Save this file as .ps1.
Run this script in Power shell from any client machine where SharePoint is accessible.
Follow on screen instructions.


FOR ANY HELP ON THIS SCRIPT USE "GET-HELP .\SCRIPTNAME.PS1 --FULL" AFTER SAVING THIS FILE.
https://drive.google.com/file/d/0BznVpoE_ln0AdFV0Y2kzLWt0c2s/view?usp=sharing