kwizcom banner advertisement

Failure decompressing data from a cabinet file - Error When Save Site as Template

6:20 PM    , , ,
Received an error "Failure decompressing data from a cabinet file" when trying to save a site as template. This is a known issue with no solution – occurs when we save site as a template with lot of content. KB: http://support.microsoft.com/kb/960969 . If you receive this error after increasing the list/site template maximum size, Make sure its below 500 MB. (By default, the maximum size of the list or site template is set to 10 MB!), Typically 50 MB should be ideal. stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 50000000 There is a hard limit of List/Site template size of 500MB. So set the value less than 524288000 or you will get an error when saving the list as a template! As per the above KB, You may receive error even your site template size is lesser than the configured value! So what other options left to us? Export/Import! In an another case, I open the site in SharePoint Designer, and deleted unused document templates from
Failure decompressing data from a cabinet file - Error When Save Site as Template Failure decompressing data from a cabinet file - Error When Save Site as Template Reviewed by Salaudeen Rajack on 6:20 PM Rating: 5

Managed Paths Can't be use in List/Library/SubSite Names

3:57 PM    , , , ,
We can not use Managed paths in SharePoint List or Library. E.g. "Sites" is a built-in Managed path. So you can't name any list/library/sub-sites as "Sites". This behavior is in SharePoint 2010 only and Not in MOSS 2007.  But you can use the managed paths in your Site collections. E.g. http://sharepoint.company.com/sites/sites
Managed Paths Can't be use in List/Library/SubSite Names Managed Paths Can't be use in List/Library/SubSite Names Reviewed by Salaudeen Rajack on 3:57 PM Rating: 5

Pick the right w3wp.exe to attach among Multiple Worker processes while debugging

2:30 PM    , , , , , ,
When multiple web applications running with multiple application pools, they will create multiple worker processes (W3WP.exe). While debugging code from Visual studio, we got pick the one belongs to the target web application, otherwise, debugger will not stop on break-points! Don't forget to select "Show processes from all users", otherwise w3wp won't be showing up in attach process window! attach w3wp process visual studio 2010 How to select the correct W3WP.exe to attach? If you use different user accounts for different application pools, you can just pick the right one easily by checking "User Name" column. Follow these instructions to find the right worker process to attach: From the running processes, we'll have to get the process id value. Lets go to Windows Task Manager >> View >> Select Columns (You'll see multiple w3wp.exe in task manager)   Select the "PID (Process Identifier)" column from the list.
Pick the right w3wp.exe to attach among Multiple Worker processes while debugging Pick the right w3wp.exe to attach among Multiple Worker processes while debugging Reviewed by Salaudeen Rajack on 2:30 PM Rating: 5

Create Folders and Sub-Folders in SharePoint Programmatically

2:01 PM    , , ,
How to create Folders in SharePoint 2013? To create a folder in SharePoint list or Library, follow these steps: Navigate to your SharePoint list or library From the "Files" tab on the Ribbon, Click on "New Folder" button Give a name to your new folder and click "Save" What if you don't find "New Folder" button in the ribbon?  If you don't get "New Folder" button, it could be disabled. Here is how to enable folders in SharePoint list: Go to List Settings, Click on "Advanced Settings" Scroll down and set "Yes" to Make "New Folder" command available option. In a Migration automation tool development, had to create folders and sub-folders from the code programmatically. Here I'm sharing the code snippets in C# and in PowerShell. using (SPSite site = new SPSite("http://sharepoint.company.com")) { using (SPWeb web = site.OpenWeb())
Create Folders and Sub-Folders in SharePoint Programmatically Create Folders and Sub-Folders in SharePoint Programmatically Reviewed by Salaudeen Rajack on 2:01 PM Rating: 5

Get SPWeb Object from the URL

5:46 PM    , , , ,
PowerShell Snap-in for SharePoint 2010 offers Get-SPWeb cmdlet to get SPWeb Object directly from the given web URL. But when writing .Net code in C# (or in PowerShell with MOSS 2007) SharePoint object model doesn't offer this mechanism. However there is a Trick to get SPWeb Object from given URL: Get the SPWeb by calling SPSite.OpenWeb() Method. Get SPWeb from Given URL: C# Code: Using(SPSite site=new spsite(URL)) { using(SpWeb web=site.openweb()) { //Do something } } Same way, With MOSS 2007 PowerShell: $webURL="http://sharepoint.compnay.com/sites/sales/us" #Subsite $site = New-Object Microsoft.SharePoint.SPSite($WebURL) $web= $site.OpenWeb()
Get SPWeb Object from the URL Get SPWeb Object from the URL Reviewed by Salaudeen Rajack on 5:46 PM Rating: 5

Cannot open database 'WSS_Content' Requested by the login. The login failed.

7:41 PM    , , , , ,
In a SharePoint 2007 environment, All of a sudden, all custom applications which uses server object model, started failing with an error: Cannot open Database WSS_Content_SharePoint_DB requested by the login. The login Failed. Login failed for user <domain\user_account>     Root cause of the Problem : There was an old unused site collection's content database attached with the web application. Since the particular site collection was no longer needed, SharePoint Administrator just deleted the database during a maintenance window from SQL Server. But SharePoint configuration was still referring the database and trying to connect! This error got logged multiple times in event log also. So the right sequence would be: Delete the content database from SharePoint first (stsadm -o deletecontentdb or using Central Administration)  Then delete the database from SQL Server. This error may appear when there is a permission issue and can be resolved by either granting access
Cannot open database 'WSS_Content' Requested by the login. The login failed. Cannot open database 'WSS_Content' Requested by the login. The login failed. Reviewed by Salaudeen Rajack on 7:41 PM Rating: 5

Server error in '/' Application - The Resource cannot be found - Solution

7:11 PM    , , ,
In a SharePoint 2007 environment, called for fixing a issue: All SharePoint sites appeared with an error"SharePoint server error in '/' Application The Resource cannot be found. " Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested Url: /sites/marketing/default.aspx I know this is a really common error, usually this error occurs when some resources like Master pages, User controls, etc referenced by SharePoint site doesn't exist (or got deleted!). In this case, client applied a master page via custom WSP Solution, and the code deleted master page with out changing it to default master page. Sites reported "File Not Found" Error initially. After enabling stack trace and disabled cu
Server error in '/' Application - The Resource cannot be found - Solution Server error in '/' Application - The Resource cannot be found - Solution Reviewed by Salaudeen Rajack on 7:11 PM Rating: 5

Inline Editing in SharePoint 2010 - How to Enable? Not working? Set the Style to Default

7:05 PM    , , ,
Inline Editing feature in SharePoint 2010 provides us an option for editing items in the same page - Same Line, with out going to a separate edit form. How to enable inline editing SharePoint 2010 Its configured in View's settings. To activate inline editing in SharePoint 2010, Just modify the view of the relevant List or Library. and enable the check-box for "Allow Inline Editing". Once enabled, You will get an Edit icon when you hover over list items. Remember, you can't edit the read-only fields (such as ID, calculated columns, Read only Fields - Created by, Modified, etc) in Inline editing. On clicking edit icon, you will get edit options for all editable controls of the item. Once done with your edit, you can either save or cancel editing by clicking on relevant button. Inline Editing Doesn't Work in even after you enable the "Allow Inline Editing" check-box? Inline editing only works, when you setup the view style to "Defau
Inline Editing in SharePoint 2010 - How to Enable? Not working? Set the Style to Default Inline Editing in SharePoint 2010 - How to Enable? Not working? Set the Style to Default Reviewed by Salaudeen Rajack on 7:05 PM Rating: 5

SharePoint Designer "Error Reading File" - Bulk Blank Lines Fix

1:47 PM    , ,
Getting "Error Reading File" when trying to open a page in SharePoint Designer? Well, its a bug! SharePoint designer inserts Blank lines in the aspx file when you edit!! Fix: Open the page as text in SPD (or any other Text editor), Remove Blank Lines (Careful! Don't delete the code. Delete only blank lines). You can select few blank rows, and use Find & Replace! Here is the screenshot: Find the blank lines SharePoint designer adds, Remove Empty rows from the file. There is a utility in codeplex: http://sharepointfilerepair.codeplex.com/
SharePoint Designer "Error Reading File" - Bulk Blank Lines Fix SharePoint Designer "Error Reading File" -  Bulk Blank Lines Fix Reviewed by Salaudeen Rajack on 1:47 PM Rating: 5

Find All Sites and Lists with Unique Permissions

4:30 PM    , , , , , , , ,
Requirement is to Get the report of SharePoint 2010 (or 2007) Sites and Lists where Permission Inheritance is broken. PowerShell to Generate report for Unique Permissions: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Get All Web Applications $webApps = Get-SPWebApplication #"http://sharepoint.company.com" #Write Header to CSV File "Site/List `t Title `t URL" | out-file UniquePermissions.csv foreach ($webApp in $webApps) { foreach ($site in $webApp.Sites) { foreach ($web in $site.AllWebs) { if ( ($web.HasUniqueRoleAssignments) -and ($web.IsRootWeb -eq $false)) { $result ="Site `t $($web.Title) `t $($web.Url)" $result | Out-File UniquePermissions.csv -Append #You can get the permissions applied by: $web.permissions | format-list member, basepermissions } foreach ($list in $web.Lists) { if (($list.HasUniqueRoleAssignments) -and ($list.Hidden -eq $false))
Find All Sites and Lists with Unique Permissions Find All Sites and Lists with Unique Permissions Reviewed by Salaudeen Rajack on 4:30 PM Rating: 5

Bulk Upload Files to SharePoint using PowerShell

1:54 PM    ,
Requirement is to upload multiple files from a local folder to SharePoint document library along with its Metadata. Bulk upload can be done via SharePoint interface by selecting multiple file upload, however setting metadata may be an issue, when it comes to large number of documents. PowerShell script to Bulk Upload Files to SharePoint Library: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Function to Upload File function UploadAllFilesFromDir($WebURL, $DocLibName, $FolderPath) { #Get the Web & Lists to upload the file $site = New-Object Microsoft.SharePoint.SPSite($WebURL) $web= $site.OpenWeb() #Get the Target Document Library to upload $List = $Web.GetFolder($DocLibName) #Get the Files from Local Folder $Files = Get-ChildItem $FolderPath #You can filter files by: -filter “*.pdf” #upload the files foreach ($File in $Files) { #Get the Contents of the file to FileStream $stream = (Get-Item $file.FullName).OpenRead()
Bulk Upload Files to SharePoint using PowerShell Bulk Upload Files to SharePoint using PowerShell Reviewed by Salaudeen Rajack on 1:54 PM Rating: 5
Powered by Blogger.