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 ?


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 
| 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-AIS 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-AIS 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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