SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have designed a custom Content editor web part and we exported the dwp file and added it in an site collection (Web part gallery ) and the web part is working fine when we add in any sub site in that site collection .We have about 60 Site Collections is there any way we can upload this into all the web part galleries ?

share|improve this question
up vote 4 down vote accepted

you can use PowerShell script to upload your dwp file to web parts gallery.

$urls = { "url1", "url2", ..., "url60" }

foreach($url in $urls){
     $libraryUrl=$url + "/" + $libraryFolder
     UploadFile $srcPath "your.dwp" $libraryUrl $libraryFolder 
share|improve this answer
Just to add, uploading the webpart file to gallery does not itself add safe control entries in the web.config file. – Nadeem Yousuf Aug 14 '13 at 9:35
@NadeemYousuf, I think that Anil configured CEWP on a page and then exported it. In this case safe control for CEWP is already added. – Alexander Aug 14 '13 at 10:33
Agreed. My comment was only for the sake of information. It may be that his site collections belong to different web applications. – Nadeem Yousuf Aug 14 '13 at 10:46

You can create a feature. If all site collections are in same web app deploy it at web app level else deploy it at farm level. Then activate your feature and you are good to go.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.