Showing posts with label webpart. Show all posts
Showing posts with label webpart. Show all posts

Saturday, 5 November 2016

Properly Install/Uninstall/Update Sharepoint Solution


Today I am providing the Power Shell Script that will install, uninstall or update a SharePoint solution (wsp file) in SharePoint. It will also activate/deactivate the site collection, Web app feature in SharePoint web application/Site collection.

Inputs
Path - Provide log file path to save the logs of the script.
Action - Select option to be performed - 1 for update, 2 for Install or 3 for Uninstall
webapplication url - provide web application url for installing the wsp file and activating the feature.

Outputs
Solution will be installed, uninstalled and updated on the bases of selected option.if you are selecting uninstall or update solution a backup of existing wsp will be taken from SharePoint in log file path.

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

Dependencies –
Solution and script should be saved in same folder. it will install/uninstall all the solutions.
For activating/deactivating a feature, feature name should contain the name of wsp file in its name.
For executing this script user must be added in site collection administrators in 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.
Follow on screen instructions.

FOR ANY HELP ON THIS SCRIPT USE "GET-HELP .\SCRIPTNAME.PS1 --FULL" AFTER SAVING THIS FILE.


Go to above link to get the script.

Find a given webpart in the given site collection


Today I am providing the Power Shell Script that is useful to find out a given web part (or all) in all the pages in all over the given site collection.

Inputs
Path - Provide log file path to save the web part report.
Sitecollection url - provide site collection url where the given web part will be searched.
Webpart name - Enter the webpart name, Name is case sensitive (Use wild card (*) if you want to match a particular string in name like you can use *bp* to get the list of all page that contains any webpart which contains bp in its name or provide * to get the list of all webparts

Outputs
A CSV file will be generated with the url of the pages where a given web part is available. or all the web parts available.

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

Dependencies –
For executing this script user must be added in site collection administrators in 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.
Follow on screen instructions.

FOR ANY HELP ON THIS SCRIPT USE "GET-HELP .\SCRIPTNAME.PS1 --FULL" AFTER SAVING THIS FILE.


Thursday, 7 April 2016

Power Shell Scripts

In This blog you will found use full Power Shell Scripts

  1. Using Task Scheduler to automate PowerShell Scripts
  2. Safely Install/Uninstall/Update a SharePoint Solution
  3. Get List of all SharePoint's Web Applications, Site Collections, Sub sites, List/Library
  4. Download All items from SharePoint in Local Farm
  5. Download Content using filter on given Column in Given site and list
  6. Get the list of All Users and Groups of a given site
  7. Get the list of All Users and Groups of Local Farm
  8. Download All solutions (wsp files) in SharePoint
  9. Set Lock State in a Site Collection (Site is in Read Only Mode Solved)
  10. Enable/Disable Save Site as Template Option
  11. Enable/Disable Delete and Save List/Library as template option
  12. Create List/Library
  13. Clear Cache of all severs in one go
  14. Granting permissions to users and groups on item level
  15. Creating a normal or host named Site Collection on given database
  16. Creating a new Content database on a given web application
  17. Modify the Site url of content type hub in Managed Metadata service application
  18. Delete Site/Site collection in bulk using a csv file
  19. View Threshold limit issue in List/Library
  20. Enable Developer Dashboard
  21. Reset BLOB Cache 
  22. Find a given webpart in the given site collection
  23. Map User profile property for Ad Synchronization