Welcome control is normally present in layouts/controltemplates folder. To create new item in welcomecontrol, take a backup of existing control and work on the backupfile. Do not modify the welcome control file directly. Below are steps to create new link in contextual menu of welcome control.
1. Take a backup of existing welcome control
2. In <CustomTemplate> tag , add below line of code for the new link
<SharePoint:MenuItemTemplate runat="server" id="NewLink"
Text="New LInk"
Description=New LInk"
MenuGroupId="300"
Sequence="1001"
ClientOnClickNavigateUrl="~site/_layouts/15//NewLink.aspx"
HiddenScript ="GetLinkVisibility();"
/>
where
ID - Id of contextual menu
Text - Text to be displayed
Description - Description of the menu item
MenuGroupId - Id of the group in which the link is to be displayed
Sequence - Sequence order in which the link is to be displayed. Increment the order from the last menu item
HiddenScript - Calls javascript method which will return values (true or false) to set visibility of the link
3. If link is to be displayed based on certain user permission, write the c# code at top as below
<script type="text/javascript">
var linkVisibility;
function SetLinkVisibility(reportVisiblity) {
if(reportVisiblity=='visible')
{
linkVisibility=false;
}
else
{
linkVisibility=true;
}
}
function GetLinkVisibility()
{
return linkVisibility;
}
</script>
<script runat="server">
protected override void OnLoad(EventArgs e)
{
if (!Page.IsPostBack)
{
SPSite site = SPContext.Current.Site;
SPWeb web = site.OpenWeb();
SPRoleDefinitionBindingCollection usersRoles = web.AllRolesForCurrentUser;
SPRoleDefinitionCollection roleDefinitions = web.RoleDefinitions;
SPRoleDefinition roleDefinition = roleDefinitions["CustomPermissionLevel"];
if (usersRoles.Contains(roleDefinition))
{
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "visiblelinks", "javascript:SetLinkVisibility('visible');", true);
}
else
{
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "hidelinks", "javascript:SetLinkVisibility('hidden');", true);
}
}
base.OnLoad(e);
}
</script>
4. Update the reference of the welcome control in master page.
Showing posts with label SharePoint 2013. Show all posts
Showing posts with label SharePoint 2013. Show all posts
Friday, February 06, 2015
Wednesday, December 10, 2014
Create Reminder mails on Task List
Below are Out of Box steps to send task due reminder mails in SharePoint. The below approach is applicable for both SharePoint 2010 and SharePoint 2013.
1. Create Task list
2. Create a workflow using SharePoint Designer to send emails to users. Include condition to send mails only for due tasks/overdue tasks
3. Uncheck all the checkboxes in Start Options for the workflow
4. Publish the workflow
5. In Task list navigate to List Settings
6. Click on Information management policy settings - >Task
7. Click on Enable Retention
8. Click on Add a Retention stage

9. Enter settings for Time Period as Due Date + 0 days
10. In Actions, select Start a workflow and select the workflow created
11. If reminder mail is to be sent every day, then check the checkbox for Recurrance and enter 1 day
12. Navigate to Central Admin -> Monitoring
13. Click on Review Job Definitions
14. Click on Information Management Policy .
15. Configure it to run Daily. Default setting is to run every Friday at 11 pm
16. Click on Expiration Policy
17. Configure it to run Daily, couple of hours after Information Management Policy runs. Default setting is to run every Saturday at 11 pm
Below are Out of Box steps to send task due reminder mails in SharePoint. The below approach is applicable for both SharePoint 2010 and SharePoint 2013.
1. Create Task list
2. Create a workflow using SharePoint Designer to send emails to users. Include condition to send mails only for due tasks/overdue tasks
3. Uncheck all the checkboxes in Start Options for the workflow
4. Publish the workflow
5. In Task list navigate to List Settings
6. Click on Information management policy settings - >Task
7. Click on Enable Retention

9. Enter settings for Time Period as Due Date + 0 days
10. In Actions, select Start a workflow and select the workflow created
11. If reminder mail is to be sent every day, then check the checkbox for Recurrance and enter 1 day
12. Navigate to Central Admin -> Monitoring
13. Click on Review Job Definitions
14. Click on Information Management Policy .
15. Configure it to run Daily. Default setting is to run every Friday at 11 pm
16. Click on Expiration Policy
17. Configure it to run Daily, couple of hours after Information Management Policy runs. Default setting is to run every Saturday at 11 pm
18. Now the reminder mails will be sent daily once the tasks are due till its completed
References
Friday, October 17, 2014
Retrieve count of documents in Search Index - SharePoint 2013
To retrieve count of documents in search index, save below script as .ps1 file and run it using powershell
Reference
https://gallery.technet.microsoft.com/office/Script-to-report-total-88056b1b
<# .SYNOPSIS Script to get the total number of indexed documents .DESCRIPTION For the given Search Application, return the total number of indexed documents. This will be the sum of indexed documents for all index partitions. .PARAMETER SearchApplication Search application to use. Multiple SSA's can be specified by piping them in to the script. In that case the result will be an array of document counts, one for each SSA .EXAMPLE Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchIndexedDocumentCount.ps1 88123 .LINK http://gallery.technet.microsoft.com/ScriptCenter .NOTES File Name : Get-SPEnterpriseSearchIndexedDocumentCount.ps1 Author : Matthew King #> [CmdletBinding()] param([Parameter(ValueFromPipeline=$True)] [Microsoft.Office.Server.Search.Cmdlet.SearchServiceApplicationPipeBind]$SearchApplication) Process { $ssa = Get-SPEnterpriseSearchServiceApplication $SearchApplication $topo = Get-SPEnterpriseSearchTopology -SearchApplication $ssa | ? { $_.State -eq 'Active'} $count = 0 Get-SPEnterpriseSearchComponent -SearchTopology $topo | ` ? { $_ -is [Microsoft.Office.Server.Search.Administration.Topology.IndexComponent] } | ` Sort-Object IndexPartitionOrdinal -Unique | % { $component = $_ [int]$c = $ssa | Get-SPEnterpriseSearchStatus –HealthReport –Component $component.Name | ` ? { $_.name -match 'number of documents\[' } | % { $_.message } Write-Verbose ("{0} {1} {2} " -f $ssa.Name, $component.Name, $c) $count += $c } $count }
Reference
https://gallery.technet.microsoft.com/office/Script-to-report-total-88056b1b
Labels:
Count of Documents,
Search,
Search Index,
SharePoint 2013
Delete Search Index - SharePoint 2013
To delete search index in SharePoint 2013, it can be done by Central Admin or by powershell. To delete it using powershell run below command
(Get-SPEnterpriseSearchServiceApplication).Reset($true,$true)
If it takes a long time to delete index and ultimatley if it gives time out error, follow below steps
Reference
http://blogs.technet.com/b/maruntz/archive/2013/04/10/reset-the-content-index-of-sharepoint-server-2010-via-powershell.aspx
https://social.technet.microsoft.com/Forums/sharepoint/en-US/ede11fc6-59a7-47be-893d-dc1ea4c88879/cant-reset-index-sharepoint-2013
(Get-SPEnterpriseSearchServiceApplication).Reset($true,$true)
If it takes a long time to delete index and ultimatley if it gives time out error, follow below steps
- Stop the Windows SharePoint Services Timer service (Found in Windows Services)
- Navigate to the cache folder
- In Windows Server 2008, the configuration cache is in the following location:
- Drive:\ProgramData\Microsoft\SharePoint\Config
- In Windows Server 2003, the configuration cache is in the following location:
- Drive:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config
- Locate the folder that has the file "Cache.ini"
- (Note: The Application Data folder may be hidden. To view the hidden folder, change the folder options as required)
- Back up the Cache.ini file.
- Delete all the XML configuration files in the GUID folder. Do this so that you can verify that the GUID folder is replaced by new XML configuration files when the cache is rebuilt.
- Note When you empty the configuration cache in the GUID folder, make sure that you do not delete the GUID folder and the Cache.ini file that is located in the GUID folder.
- Double-click the Cache.ini file.
- On the Edit menu, click Select All. On the Edit menu, click Delete. Type 1, and then click Save on the File menu. On the File menu, click Exit.
- Start the Windows SharePoint Services Timer service
- Note The file system cache is re-created after you perform this procedure. Make sure that you perform this procedure on all servers in the server farm.
- Make sure that the Cache.ini file in the GUID folder now contains its previous value. For example, make sure that the value of the Cache.ini file is not 1.
Reference
http://blogs.technet.com/b/maruntz/archive/2013/04/10/reset-the-content-index-of-sharepoint-server-2010-via-powershell.aspx
https://social.technet.microsoft.com/Forums/sharepoint/en-US/ede11fc6-59a7-47be-893d-dc1ea4c88879/cant-reset-index-sharepoint-2013
Subscribe to:
Posts (Atom)











