Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

2 Answers 2

up vote 4 down vote accepted

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

$urls = { "url1", "url2", ..., "url60" }
$srcPath="c:\temp"
$libraryFolder="_catalogs/wp"

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

 
discard

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.