25 December, 2012

Add, Remove, System created List Columns in SharePoint Designer

If you wish to Add/Remove system generated columns in SharePoint designer (SPD), you need to first open up the site in SPD then open any view’s aspx file.
In design mode, you need to right click on the DataFormWebPart and select “convert to XLST data view”.

Now you should have a “Common data view tasks” popup, if not, just click on the arrow to the right. You could then select “edit columns”.
Select single column (which you wish to delete), right click on the column and select Delete Column. You desired columns will be deleted. 

Now you will be able to add/remove columns in SharePoint Designer Save the file when you done and your SharePoint site will be automatically updated with the new columns.
If you have any concerns/queries do let me know.
More details on Data Form WebPart

You cannot switch the user account in SharePoint Designer 2013

SharePoint Designer is a powerful application that enables the rapid creation, editing and deployment of content on the SharePoint platform.

Microsoft has already published a document on this issue and here is the KB article for this:

Additional references:
Please refer the following error messages:

1.      Indexer process doesn’t free up old memory after repartitioning

2.      New-SPEnterpriseSearchIndexComponent checks the existence of RootDirectory in the wrong server

3.      PerformancePoint Dashboard Designer Help doesn’t open as expected

4.      PowerPoint intent isn’t shown

5.      Repair operations on SharePoint Standalone can delete your content database

6.      WSS Sync failed to run in because of a lack of profile database permission

7.      Cannot process argument because the value of argument"implementingType" is null. Change the value of argument "implementingType" to a non-null value.

8.      "Error occurred in deployment step 'Add Solution': Cannot start service SPUserCodeV4 on computer ..."

9.      Unable to retrieve topology component health states. This may be because the admin component is not up and running.

If you are facing any error messages which are listed above then please refer the following Microsoft article for the details workaround information:

If you have any queries/questions regarding the above mentioned information then please let me know. Thank you.

SharePoint Designer permission requirements

SharePoint Designer is a powerful application that enables the rapid creation, editing and deployment of content on the SharePoint platform. As such, certain mandatory permission levels are required.

Detail Information:

After enabling SharePoint Designer at the web application level and site collection level, the next steps are to select the users that will be enabled to access, create, and modify SharePoint content through SharePoint Designer.

SharePoint Designer is designed to request and use SharePoint permissions that grant the rights of managing & designing at the SharePoint site level it is not design to use the permission at a smaller granularity level such as list item level permissions..

Reference Documents:

Conclusion:
To be able to use SharePoint Designer and modify SharePoint content, an user needs to be a member of one of the following groups at the site collection level:
1.      Site Collection Administrators group
2.      The Designers group
3.      Owners group

If you have any queries/questions regarding the above mentioned information then please let me know. Thank you.

24 December, 2012

IT Security Bulletin: December 2012.

SQL injection is used by hackers to gain access to your database. Cross-site scripting lets a hacker add code to your website to execute tasks. A few simple steps can protect against these common attacks if you know where the weaknesses are in your network.
This 45-page guide will help you understand the risks facing your business today. It focuses specifically on the risks of data loss and loss of customer trust and discusses the ways you can use SSL to protect yourself and your business.

This guide will help you understand the methods, implications and protection measures of attacks such as intercepting communications, spoofing, directed attacks, improperly managed access control and more.

5 PowerShell snippets for SharePoint branders

A very good post by Christian on PowerSheel Snippets.
PowerShell is a command-line scripting tool that provides an administrator full access to applicable application programming interfaces (APIs), along with the ability to unlock the capability to interact directly with SharePoint 2010 Products to manipulate Web applications, site collections, sites, lists and much more. So what’s a useful thing to do with PowerShell as a SharePoint brander or a front end developer? Well, there are a lot of different types of tasks you can use PowerShell to, for example populate a list with a large amount of objects when you need to performance test your Data View Web Part or if you need to apply a theme to let’s say some site in the structure including its sub sites or if you need to batch update properties of a collection page layouts.
Maybe you see something that can be written more efficient or if you have some cool snippets of your own you like to share, please drop this in a comment. Take these snippets as they are, try them first in your developer or test environment and feel free to use them and modify in the way you want.
Running PowerShell scripts is easy and you will find many resources out there if you never used PowerShell before, when you know the basics it’s just to go ahead and try these out. This stuff is written for SharePoint 2010 but most of this can be used in SharePoint 2013 as it is.
1. Change Master Page for all sites in the collection
In this example, we are apply a customer master to all the sites in the site collection, this can be rewritten specific for SharePoint foundation, where PowerShell is much useful for such task. In this snippet I have set V4.master, so have to change the name of the master page file if apply a custom master page.
# ----- For publishing sites and non publishing sites
$site = Get-SPSite http://intranet
foreach ($web in $site.AllWebs) {
$web; $web.CustomMasterUrl = "/_catalogs/masterpage/V4.master";
$web.Update(); $web.CustomMasterUrl;
$web.Dispose()
}
foreach ($web in $site.AllWebs) {
$web; $web.MasterUrl = "/_catalogs/masterpage/v4.master";
$web.Update(); $web.MasterUrl;
$web.Dispose()
}
$site.Dispose()
write-host "Complete! V4.master is now applied";
2. Set alternate CSS
In this way you can set a custom CSS file as an alternate CSS at the top site of your site collection, publishing sub sites will inherit the alternate CSS by default.
$web = Get-SPWeb http://intranet
$web.AlternateCssUrl = "/Style Library/MyStyles/main.css"
$web.AllProperties["__InheritsAlternateCssUrl"] = $True
$web.Update()
3. Set a site logo
With this one you can associate a logo with all sites in the site collection by entering the URL to an image file.
(get-spsite http://intranet).AllWebs | foreach {
$_.SiteLogoUrl = "/Style%20Library/MyClient/Images/ClientLogo.png";
4. Set regional setting/locale
This one can be handy when you need to specify the way the site displays numbers, dates, and time. In this example I set locale to Swedish (1053).
$site = Get-SPSite http://intranet
foreach ($web in $site.AllWebs) {
$web; $web.Locale = 1053;
$web.Update(); $web.Locale;
$web.Dispose()
}
$site.Dispose()
5. Set a theme
This one will set a theme to all sites in the site collection. This script is originally written by MVP Yaroslav Pentsarskyy
$SiteUrl = "http://intranet"
$NewTheme = "Azure"
# Loading Microsoft.SharePoint.PowerShell
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null) {
Write-Host "Loading SharePoint Powershell Snapin"
Add-PSSnapin "Microsoft.SharePoint.Powershell"
}
# Setting site themes on sites and sub sites
$SPSite = Get-SPSite | Where-Object {$_.Url -eq $SiteUrl}
if($SPSite -ne $null)
{
$themes = [Microsoft.SharePoint.Utilities.ThmxTheme]::GetManagedThemes($SiteUrl);
foreach ($theme in $themes)
{
if ($theme.Name -eq $NewTheme)
{
break;
}
}
foreach ($SPWeb in $SPSite.AllWebs)
{
$theme.ApplyTo($SPWeb, $true);
Write-Host "Set" $NewTheme "at :" $SPWeb.Title "(" $SPWeb.Url ")"
}
}
Write-Host "Themes updated at:" $SPSite.Url -foregroundcolor Green
More
If you’re a truly SharePoint Designer guy, why not use PowerShell to check if you allowed to do your branding stuff before fire it up…
Get-SPDesignerSettings -webapplication http://intranet
There’s lot of blogs about using PowerShell in SharePoint but here’s a pic of a few cool scripts that somehow are related to this topic.
Finally he’d like to give thanks to MVP Cathy Dew for inspiring discussions about this topic; PowerShell from a brander’s perspective as well as he’d like to thanks Falak Mahmood for general discussions and suggestions for the use of PowerShell.