About Me

Having 12 years experience in Microsoft technologies.Since more than 7 years working in SharePoint technologies. Expert in providing consultation for SharePoint projects. Hands on with development and administration.
Showing posts with label features. Show all posts
Showing posts with label features. Show all posts

Thursday, 12 December 2013

Activate a feature in all the SharePoint site collections-PowerShell

$webAppUrl = "Web Application URL"
 

$webapp = Get-SPWebApplication $webAppUrl  | Get-SPSite -Limit All | Get-SPSite -limit 

all | ForEach-Object {Enable-SPFeature -Identity 'Feature guid'  -Url $_.Url}

Thursday, 27 October 2011

Making a Web Part Safe by Default

If you have a Web Part and want to make it safe anyway, you can add this information to the solution package, as shown in the following code.
<Solution SolutionId="{2E9DDE85-8822–42EC-3a92–E85537810BAA}"
xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureManifests />
<ApplicationResourceFiles />
<CodeAccessSecurity />
<DwpFiles />
<Resources />
<RootFiles />
<SiteDefinitionManifests />
<TemplateFiles />
<Assemblies>
<Assembly DeploymentTarget="WebApplication" Location="Apress.WebParts.dll">
<SafeControls>
<SafeControl Assembly="Apress.WebPart, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=a05eff78260564"
Namespace="Apress" TypeName="*" Safe="True"/>
</SafeControls>
</Assembly>
</Assemblies>
</Solution>
This technique is limited to your own Web Parts, where you have control over the packaging process. But it’s the safest way to add controls to web.config.