Wednesday 6 September 2017

Update List/Library url in SharePoint Online

Today I am providing the Power Shell Script that will update the Title and URL of a given List/library in a SharePoint online site as per user input and requirement.

Inputs
Username - User name to connect to the site. User should be global admin and must have full control on the site
Password - Password for the given user
siteURL - URL of the site where list/library exist
listtitle - Library title 
listtitlenew - Please enter the new display name for given list/Library. Enter same name as above if you dont want to change the title
newurl - Enter new url without space

Outputs
Script will update the title and url of the given list/library.

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

Dependencies –
This script sould be executed from a Machine where SharePoint Online Management Shell is installed.
Machine should be connected to Internet.
Make sure SharePoint Management Shell, Powershell or Powershell ISE what ever you are using to run this script must be started as administrator.
For executing this scipt User must be a global admin in Office 365 and must have contribute permission on the list/library.
How to execute -
Copy this script and paste in Note pad.
Save this file as .ps1.
Run this script in SharePoint Online Management Shell/Power shell/ Power shell ISE.
Follow on screen instructions.

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

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