kwizcom banner advertisement

Add Attachment Field in SharePoint 2013 List Form

11:04 AM    , , ,
Requirement: Add attachment column to a custom new/edit forms in SharePoint 2013. Solution: Create new custom list forms for New and Edit in SharePoint designer 2013, Add this code to the custom list form in the location where you want the attachment field to appear. <td colspan="2"> <table> <tr> <td style="width:170px"> <b>Upload Approval E-Mails: </b> </td> <td valign="top" class="ms-formbody" id="attachmentsOnClient"> <input type="file" name="fileupload0" id="onetidIOFile" size="50" title="Name"> </input> </td> <td> <input name="attachButton" type="button" value="Attach" onclick='OkAttach()' /> </td> </tr> </table> </td> Result: Here is the SharePoint custom edit form with attachment field.
Add Attachment Field in SharePoint 2013 List Form Add Attachment Field in SharePoint 2013 List Form Reviewed by Salaudeen Rajack on 11:04 AM Rating: 5

Export-Import All Lists and Libraries from One Site to Another using PowerShell

7:28 PM    , , , , , , ,
Requirement is to copy and paste all SharePoint lists and libraries from one site to another. While "Save List as a Template" is one approach, it doesn't work for larger lists and its time consuming. Using Central Administration export method also kills my time. Solution: We can copy and paste SharePoint lists using PowerShell script. Export document library using PowerShell in SharePoint 2013: Syntax: Export-SPWeb <Web-URL> -Path <Backup-Path> -ItemURL <Library-URL> -IncludeUserSecurity  -IncludeVersions All E.g. Export-SPWeb http://sharepoint.crescent.com/Teams/2015-ESG/ –Path "D:\Documents.cmp" -ItemURL "Documents" –IncludeUserSecurity -IncludeVersions All Import document library in SharePoint 2013 using PowerShell: Syntax: Import-SPWeb <<web-URL>> -path <<Backup-file>> –force –IncludeUserSecurity -UpdateVersions Overwrite E.g. Import-SPWeb https://sharepoint.crescent.com/Teams/2016-ESG/&q
Export-Import All Lists and Libraries from One Site to Another using PowerShell Export-Import All Lists and Libraries from One Site to Another using PowerShell Reviewed by Salaudeen Rajack on 7:28 PM Rating: 5

Save Site as Template Option Missing in SharePoint 2013?

4:53 PM    , , , , ,
Perhaps the most easiest way to create a standard site template is to Create a site,  Add-remove content, list and libraries and save it as a template. But SharePoint 2013 does not support "Save Site as Template" option on Publishing sites. If a site with "SharePoint Server Publishing" is activated this option will not available in  Site settings, So you can't save site as template! In SharePoint 2007 and  SharePoint 2010 we use a trick by appending the URL: "/_layouts/savetmpl.aspx" to get this functionality! Unfortunately, you cannot save site as template in SharePoint 2013 using this trick! if you try accessing the page with the above trick, you'll get an error message: Sorry, Something went wrong - The "Save site as template" action is not supported on this site. Enable save site as template in SharePoint 2013 publishing sites: How to enable save site as template SharePoint 2013? Well, this issue can be resolved by either of
Save Site as Template Option Missing in SharePoint 2013? Save Site as Template Option Missing in SharePoint 2013? Reviewed by Salaudeen Rajack on 4:53 PM Rating: 5

Property Bags in SharePoint 2013 - Store, Retrieve Custom Configurations

11:49 AM    , , , , ,
As its name suggests, Property bag feature provides a convenient way to store and retrieve custom configurations, instead of having to store them in web.config files. Property bags in SharePoint stores configuration data in the Hash-Table (Key-Value) format. We can store and retrieve properties at the following levels:  Farm (SPFarm ) Web application (SPWebApplication ) Site collection (SPSite ) Site (SPWeb ) List (SPList ) Folder (SPFolder) File (SPFile) List Item (SPListItem) Property bags can be created, edited and deleted at all of these level.   Property bag keys are case sensitive! How to use property bag SharePoint ? If your SharePoint application uses any specific setting for each and individual SharePoint object, such as Web Application, Site Collection, Site, etc. you have maintain those entries in the config files. Here is where SharePoint property bags can be a great helper. There is no out-of-box user interface to manage property bag settings i
Property Bags in SharePoint 2013 - Store, Retrieve Custom Configurations Property Bags in SharePoint 2013 - Store, Retrieve Custom Configurations Reviewed by Salaudeen Rajack on 11:49 AM Rating: 5

Restart IIS (IISRESET) on All Servers in the SharePoint Farm using PowerShell

6:04 PM    , , , ,
Doing IISReset on Server Farm with Multiple SharePoint servers is a painful processes. If you ever need to restart IIS on all servers in the SharePoint farm, Here is a nifty solution to do IISRESET on all SharePoint Servers using PowerShell: PowerShell Script to Restart IIS on All SharePoint Servers: Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue #Get All SharePoint Servers - Except DB and SMTP Servers $Servers = Get-SPServer | Where {$_.Role -ne "Invalid" } #Iterate through the list and restart one by one. foreach ($server in $servers) { Write-Host "Restarting IIS on server: $($Server.Name)" IISRESET $Server.Address #Optional: Get the Status Write-Host "IIS status for server $($server):" IISRESET $server.Address /status } Write-host "IIS Restarted on All Servers of the Farm!" -f Green Make sure, you have "Local Administrator" Permission on
Restart IIS (IISRESET) on All Servers in the SharePoint Farm using PowerShell Restart IIS (IISRESET) on All Servers in the SharePoint Farm using PowerShell Reviewed by Salaudeen Rajack on 6:04 PM Rating: 5

Set Max Degree of Parallelism for SharePoint 2013 in SQL Server 2012

11:01 AM    , , ,
What is max degree of parallelism in SQL Server ? SQL Server configuration option 'max degree of parallelism' limits the number of processors used for the execution of a query with a parallel plan. By default its set to '0' to allow all processors available.  SharePoint 2013 requires that "max degree of parallelism" option be set to exactly 1 to ensure each request is served by a single SQL Server process. You may get configuration failed error in SharePoint 2013, if max degree of parallelism isn't set to 1. This SQL Server instance does not have the required "max degree of parallelism" setting of 1. Database provisioning operations will continue to fail if "max degree of parallelism" is not set 1 or the current account does not have permissions to change the setting. In SharePoint 2010 days, Maximum Degree of Parallelism option was recommended, but optional. But in SharePoint 2013, it is mandatory to set its value to "1&quo
Set Max Degree of Parallelism for SharePoint 2013 in SQL Server 2012 Set Max Degree of Parallelism for SharePoint 2013 in SQL Server 2012 Reviewed by Salaudeen Rajack on 11:01 AM Rating: 5

SharePoint Site Collection vs Subsite - Determine Which One to Create

7:27 PM    , , , , , ,
SharePoint newbies often get confused with this question: When to create Site collection and when to use Subsites? What are the advantages of having a Ste collection rather subsite? Well, the choice of Site collection or subsite can be determined based on these factors: Security/Permission Management - Every Site collection uses unique security model, which means: security is isolated between site collections. Whereas subsites can inherit security from its parent site.  In an another aspect - permission management between site collections could be a nightmare. But managing permissions in subsites can be much easier and less frustrating. Re-usability: Several SharePoint components such as web parts, content types, site columns (only in SharePoint 2007), etc can be reused within all sites in a site collection. But if you have to port them to other site collections, you may require considerable efforts. Hierarchy/Navigation: Subsites can share a common navigation and structure. But
SharePoint Site Collection vs Subsite - Determine Which One to Create SharePoint Site Collection vs Subsite - Determine Which One to Create Reviewed by Salaudeen Rajack on 7:27 PM Rating: 5

Database is in compatibility range and upgrade is recommended - Solution

4:26 PM    , , , , , ,
Problem:  After a service pack upgrade in SharePoint 2013, database status under  Central Admin >> Upgrade & Migration >> Review database status - turned into "Database is in compatibility range and upgrade is recommended" Solution: In most cases, this message simply means, You have installed a latest patch/service pack and running SharePoint products configuration wizard is pending still! So, run SharePoint products configuration wizard once to clear this message. Still getting "Database is in compatibility range and upgrade is recommended" message? To resolve this error with BDC service application, just execute below cmdlet in PowerShell console. (Get-SPDatabase | ?{$_.type -eq "Microsoft.SharePoint.BusinessData.SharedService.BdcServiceDatabase"}).Provision() Once its executed BDC database status turned to "No Action Required". "Database is in compatibility range and upgrade is recommended" on Content da
Database is in compatibility range and upgrade is recommended - Solution Database is in compatibility range and upgrade is recommended - Solution Reviewed by Salaudeen Rajack on 4:26 PM Rating: 5

Solution for "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered" PowerShell Error in SharePoint 2013

1:19 PM    , , , , ,
We have a new SharePoint administrator joined in our team. We granted him access to all SharePoint servers, Added him to Farm Admin group, Web application policy.  However, when he tried launching SharePoint Management Shell or try adding the SharePoint PowerShell snap-in from PowerShell ISE, got the error message:  "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered" Solution: Grant Permissions to Run PowerShell Script on SharePoint Basically, We've to grant "Shell Admin" access rights to be able to run PowerShell scripts in SharePoint. As the first step, Add the new user to "Local Administrator" group of the SharePoint WFE/App Servers. Login as with Farm Admin access rights and run: Add-SPShellAdmin Domain\User This cmdlet grants "SharePoint Shell Access" membership rights on the SharePoint Farm configuration database and adds the user under WSS_ADMIN_WPG group in all of SharePoint front end se
Solution for "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered" PowerShell Error in SharePoint 2013 Solution for "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered" PowerShell Error in SharePoint 2013 Reviewed by Salaudeen Rajack on 1:19 PM Rating: 5

PowerShell "Exception of type 'System.OutOfMemoryException'"

3:36 PM    , ,
In middle of a script execution, Got the below error: The following exception was thrown when trying to enumerate the collection: "Exception of type 'System.OutOfMemoryException' was thrown.". At d:\Scripts\VersionRpt.ps1:19 char:16 +         foreach <<<<  ($FileVersion in $File.Versions)     + CategoryInfo          : NotSpecified: (:) [], ExtendedTypeSystemException     + FullyQualifiedErrorId : ExceptionInGetEnumerator Solution: Increase the PowerShell console memory! Here is how: C:\ CD wsman: #Get the current setting Get-Item localhost\shell\maxmemoryperShellMB #Increase the memory Set-Item localhost\shell\MaxmemoryPerShellMB 2048 BTW, You can also try disposing unused objects in PowerShell. Here, we got this exception due to the large number number of version.
PowerShell "Exception of type 'System.OutOfMemoryException'" PowerShell "Exception of type 'System.OutOfMemoryException'" Reviewed by Salaudeen Rajack on 3:36 PM Rating: 5

Find All Site Templates Used by SharePoint Sites

1:10 PM    , , ,
Requirement: Find all Site templates used in a SharePoint 2010 environment and generate report prior proceeding with Migration, as certain templates are discontinued in SharePoint 2013. Solution: Lets get site template usage report on all sites using PowerShell. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Variables $WebAppURL="http://sp10.crescent.com" #Get All Webs $WebsCollection = Get-SPWebApplication $WebAppURL | Get-SPSite -Limit All | Get-SPWeb -Limit All #Retrieve Site template data from each web foreach ($web in $WebsCollection) { $SiteName = $web.Title $SiteURL = $web.Url $SiteTemplate = $web.WebTemplate $TemplateID = $web.WebTemplateID Write-Host " $($SiteName), $($SiteURL), $($SiteTemplate) ,$($TemplateID)" } PowerShell Script to Get Web Templates of all sites and Export to CSV Report: Lets tweak it a bit to find all site templates and export to Csv file. Add-PSSnapin Mi
Find All Site Templates Used by SharePoint Sites Find All Site Templates Used by SharePoint Sites Reviewed by Salaudeen Rajack on 1:10 PM Rating: 5

How to Integrate Twitter with SharePoint to Get Twitter Feeds?

6:23 PM    , , , , ,
Although there are Twitter-SharePoint web parts in codeplex, we can integrate twitter with SharePoint with Out-of-the-box script editor/content editor web parts in few steps. Simply, follow these steps for adding twitter to SharePoint to get twitter feeds. Step 1: Go to https://www.twitter.com and Log-in to your Twitter account.(You need to have a twitter account!) Step 2: Navigate to Settings >> Widgets (https://twitter.com/settings/widgets) Step 3: In the widgets tab, Click on "Create New" button Step 4:   Under "User Timeline" tab, Click on “Create Widget” button to generate Twitter embed code. You can further customize look and feel by following developer API references. Step 5: Wait for the “Your Widget has been created.” Message from twitter. Now Copy the twitter embed code to clipboard Here is my twitter widget script generated: <a class="twitter-timeline" href="https://twitter.com/SharePointDiary"
How to Integrate Twitter with SharePoint to Get Twitter Feeds? How to Integrate Twitter with SharePoint to Get Twitter Feeds? Reviewed by Salaudeen Rajack on 6:23 PM Rating: 5

Add-SPShellAdmin: You need to have Machine administrator priviliges to run this cmdlet

7:28 PM    ,
While trying to add a new user to grant PowerShell script execution policies, Got this error message: Add-SPShellAdmin: You need to have Machine administrator priviliges to run this cmdlet Fix: Although you are in  local server Administrator group, You must run the SharePoint Management Shell as Administrator. Simply right click on SharePoint 2010/2013 Management Shell  >> Choose "Run as a administrator" Alternatively, you can disable the UAC to avoid these kind of issues. Related article: How to disable UAC in Windows 2012
Add-SPShellAdmin: You need to have Machine administrator priviliges to run this cmdlet Add-SPShellAdmin: You need to have Machine administrator priviliges to run this cmdlet Reviewed by Salaudeen Rajack on 7:28 PM Rating: 5

Download All Versions of a Document in SharePoint using PowerShell - Web Services

9:29 PM    , , , , , ,
Requirement: Wanted to extract and download each version of the document stored in a SharePoint library. Well, PowerShell can do it from client side using web services. Here is the PowerShell script to download each version to the local folder programmatically. Download all versions of a document using PowerShell # ******* Variables Section ****************** #Define these variables $WebURL="http://sharepoint.crescent.com/sites/Operations/" $FilePath ="http://sharepoint.crescent.com/sites/Operations/docs/designDoc.docx" $TargetFolder = "C:\Downloads" # ********************************************* #Web Service URL $WebServiceURL =$WebURL+"_vti_bin/Versions.asmx" $WebService = New-WebServiceProxy -Uri $WebServiceURL -UseDefaultCredential $WebService.URL=$WebServiceURL #Get File name from file path $FileName = $FilePath.Substring($FilePath.LastIndexOf("/")+1,($FilePath.Length-$FilePath.LastIndexOf("/")-1)) #Create the Ta
Download All Versions of a Document in SharePoint using PowerShell - Web Services Download All Versions of a Document in SharePoint using PowerShell - Web Services Reviewed by Salaudeen Rajack on 9:29 PM Rating: 5

Expand-Collapse All Groups in SharePoint 2013 List Views using jQuery

2:12 PM    , , ,
SharePoint doesn't has the ability to expand/collapse all groups in grouped list views. However, with jQuery we can bring Expand All-Collapse All buttons in SharePoint 2013 grouped list views. Just edit the grouped view page (Site Actions Gear >> Edit Page), add a "Script Editor" Web part and then place the below code in it. jQuery for Expand-Collapse all items in grouped views in SharePoint 2013: <script type="text/javascript" src="http://code.jquery.com/jquery-1.2.6.min.js"></script> <script type="text/javascript"> function expandAll() { $("img.ms-commentexpand-icon").click(); } function collapseAll() { $("img.ms-commentcollapse-icon").click(); } var expandButton = "<a href='#' onClick=" +'"' + "this.href='javascript:expandAll()'" + '">&nbsp;<img title="expand all grou
Expand-Collapse All Groups in SharePoint 2013 List Views using jQuery Expand-Collapse All Groups in SharePoint 2013 List Views using jQuery Reviewed by Salaudeen Rajack on 2:12 PM Rating: 5

MaximumFileSizePerExtension in SharePoint 2013

6:43 PM    , ,
In SharePoint 2013, Maximum file upload size is increased to 250MB - which means users can upload any single file up to 250MB of size. If users try to upload a file which is larger than the configured web application limit, they receive an error message saying its exceeded the maximum length allowed! SharePoint 2013 introduced a new feature called "MaximumFileSizePerExtension" to set maximum upload size exclusively for certain file types. Say for e.g. Your web application's default Maximum size for uploading files would be 250MB, But you can add an exception for "WMV" files up to 2GB! By default, Microsoft One Note files (.ONE) are configured with 1GB size limit. Here are the PowerShell cmdlets to manage this configuration. To view file types set in MaximumFileSizePerExtension property: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $WebApp = Get-SPWebApplication "http://your-sharepoint-web-app-url" $WebApp.MaximumFil
MaximumFileSizePerExtension in SharePoint 2013 MaximumFileSizePerExtension in SharePoint 2013 Reviewed by Salaudeen Rajack on 6:43 PM Rating: 5

Get SharePoint Site Collection Created Date using PowerShell

12:35 PM    , , , ,
Requirement: I had to generate a report for management review on list of site collections created in the past one Month.  Solution: Get SharePoint Site Collection Created Date using PowerShell! There is no UI to view site creation date in SharePoint! But you can get site creation date in SharePoint using PowerShell as: Write-host (Get-SPSite "http://sharepointsite.com").RootWeb.created Lets get all sites created in the past one month based on SharePoint site created date using PowerShell: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Get all site collections $SitesColl = Get-SPSite -Limit All #Get start date of Last Last Month $LastMonth= (Get-Date).AddMonths(-1) #Loop through all sites ForEach($Site in $SitesColl) { #Check site creation date if($Site.RootWeb.created -gt $LastMonth) { $CreatedDate = $Site.RootWeb.created.toShortDateString() Write-Host "$($Site.RootWeb.url) was created on $($CreatedDate
Get SharePoint Site Collection Created Date using PowerShell Get SharePoint Site Collection Created Date using PowerShell Reviewed by Salaudeen Rajack on 12:35 PM Rating: 5

How to Create a New Content Database in SharePoint 2013 using PowerShell?

7:21 PM    , , , , ,
Although a content database can accommodate up to 10,000 site collections in SharePoint, its not advisable to use it so, as the recommended size of the content database is < 200 GB in SharePoint 2013. Also, that could introduce Security, Backup-restore issues to affect your SLA. When you create new site collection in SharePoint, it picks the available database which has room. Lets see How to create new content database for SharePoint. How to add a content database in SharePoint 2013 from Central Administration site: Login to SharePoint App/WFE server as a Farm Administrator Open Central Administration >> Application Management >> Manage content databases  Click on "Add a content Database" link On the Add Content Database page: Specify a Web application for the new database. Specify a database server to host the new database Specify the number of sites collections before a warning is issued. By default, this is 9,000. Specify the total number of si
How to Create a New Content Database in SharePoint 2013 using PowerShell? How to Create a New Content Database in SharePoint 2013 using PowerShell? Reviewed by Salaudeen Rajack on 7:21 PM Rating: 5

How to Change Logo in SharePoint 2013?

5:31 PM    , , , , ,
As a branding initiative, The first thing people do to customize SharePoint site is: changing logos to their company logo. Here is how to change logo in SharePoint 2013: Navigate to the Site Settings Page by clicking "Site Settings" link from settings gear. Under the "Look and Feel" section, click on "Title, description, and icon" link.  Select the logo either from your computer ( When insert from computer, the logo will be upload to "Site Assets" library.) or from any SharePoint library. Optionally, You can enter Logo description. Click OK to apply your new logo. You can copy the logo file to your each WFE, so that the logo will be retrieved from file system rather from a SharePoint library of a site collection and the result of SharePoint 2013 change logo URL: Tips: Keep the logo background transparent so that it can match on any color theme! That's all!   FAQS on SharePoint Logo: SharePoint 2010 logo change The sam
How to Change Logo in SharePoint 2013? How to Change Logo in SharePoint 2013? Reviewed by Salaudeen Rajack on 5:31 PM Rating: 5
Powered by Blogger.