Wednesday, May 6, 2015

SharePoint 2013 Custom Master Page Apps not Loading

Design Manger Bug :


Ran into an interesting little bug this past week with SharePoint 2013 Design Manager master pages. After having a friend recreate the issue on her VM, I contacted the Microsoft product team and confirmed this is an issue they hope to solve with a future update. Essentially, if you create a master page with the Design Manager, whether a minimal master or one that has been converted from HTML and CSS, the Site Contents > Add an app page will not allow you to add apps or lists to your site. This issue also impact the out of the box Oslo master page. Here is what you should see when you go to the Add an App page:


image
With this bug you end up never seeing the Apps you can add section. Sometimes you will see the “Working on it…” message and other times you will just see the Noteworthy apps.
The key to fixing this problem is to make sure your master page includes: DeltaPlaceHolderLeftNavBar, PlaceHolderLeftNavBar, DeltaPlaceHolderPageTitleInTitleArea, and PlaceHolderPageTitleInTitleArea and that each of them is not set to Visible=False. To do this in an HTML master page with Design Manager you would add the following snippets:

<!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderLeftNavBar" BlockElement="true" runat="server">-->
<!--SPM:<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server">-->
<!--SPM:</asp:ContentPlaceHolder>-->
<!--SPM:</SharePoint:AjaxDelta>-->
<!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderPageTitleInTitleArea" runat="server">-->
<!--SPM:<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server">-->
<!--SPM:</asp:ContentPlaceHolder>-->
<!--SPM:</SharePoint:AjaxDelta>-->


With these lines in place, the Apps you can add should show up again. Note, if you aren’t making a Design Manager HTML master page you will still want to ensure these controls (without the DM comments) are included somewhere in your master page and not marked as Visible=False.




Org Article : http://blog.drisgill.com/2012/12/design-manager-bug-sharepoint-2013-rtm.html



Monday, May 4, 2015

Small Calender In Sharepoint 2013

Out put :


SharePoint 2013 Small Calendar:
   
image


Step1 :


Add Calendar webpart
Add Content editor webpart
Add the below CSS .


2013 Content Editor Web Part CSS: <style>
/**** Small Calendar ***/
.ms-acal-item{height: 10px !important;}
.ms-acal-sdiv,
.ms-acal-mdiv,
.ms-acal-ctrlitem,
.ms-acal-month-weeksel,
.ms-acal-title,
.ms-acal-month-top span{display: none;}
.ms-acal-summary-itemrow TD DIV{height: 15px !important;}
</style>




Ref : http://erikswenson.blogspot.com/2013/04/small-calendar-for-sharepoint-2010-2013.html



Thursday, March 5, 2015

Manage the Distributed Cache in SharePoint 2013

  • When SharePoint Server 2013 is installed, it assigns the Distributed Cache service 10% of the total physical memory on the server. The Distributed Cache service uses half of that memory allocation for data storage (also known as cache size, 5% cache size), and the other half of that memory allocation is used for memory management overhead. When the cached data grows, the Distributed Cache service uses the entire 10 percent of the allocated memory. In most cases, initial 5% cache size may not be enough and you may require to increase cache size to support various SharePoint features. e.g. when you install SharePoint 2013 on 8 GB RAM (8192 MB RAM), it would allocate 410 MB (5% of 8GB RAM) to the Distributed Cache size. This may not be enough to support 50 concurrent user’s My Site activities and it may require to increase the Distributed Cache size

MetricSmall FarmMedium FarmLarge Farm
Number of usersLess than 10KLess than 100KLess than 500K
Cache size1GB2.5GB12GB
Memory allocation2GB5GB24GB
ConfigurationCollocated or dedicatedDedicatedDedicated

Following commands are used to manage the Distributed cache in SharePoint 2013.

$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Provision()


$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Unprovision()






Update-SPDistributedCacheSize -CacheSizeInMB CacheSize 




$farm = Get-SPFarm
$cacheService = $farm.Services | where {$_.Name -eq "AppFabricCachingService"}
$accnt = Get-SPManagedAccount -Identity d
omain_name\user_name
$cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser"
$cacheService.ProcessIdentity.ManagedAccount = $accnt
$cacheService.ProcessIdentity.Update() 
$cacheService.ProcessIdentity.Deploy()

Use-CacheCluster      :


Distributed cache use this command to enable cache administration via PowerShell

Get-CacheHost 

Use this command to determine the status of the cache service on each server in the cluster. You should get a listing of every server as well as the state of the service on that server.


Get-CacheHostConfig <HostName> <Port>


Use this command to get general configuration details about a specific host in the cache cluster. All Windows Server AppFabric cache hosts use TCP/IP to communicate with each other and support the cache cluster. The SharePoint distributed cache is an AppFabric cache behind the scenes and it uses the default AppFabric ports for server to server communication. These ports should be allowed through your firewalls for the cache service to function correctly.



Get-CacheAllowedClientAccounts
This command will tell you which accounts/groups have rights to connect to the cache cluster as clients. This seems to be the standard configuration in SharePoint 2013.


Get-Cache

Gets a listing of all the default caches in the farm. All caches have the Id (Guid) of the farm appended to the name.


Get-CacheConfig <CacheName>

Get details about a specific cache instance





Restart-CacheCluster

Restarts the distributed cache service on all servers in the cluster. It will also clear the contents of the cache.




Stop-SPDistributedCacheServiceInstance -Graceful

Stop the distributed cache service on an individual machine. The Graceful parameter will allow the cache service to migrate cached items to another host.

Remove-SPDistributedCacheServiceInstance

Removes a cache host from the cluster. It’s always a good idea to stop the cache service before you remove it.

Add-SPDistributedCacheServiceInstance

Adds a cache host back to the cluster. If there is more than one host in the cluster, it will take a few minutes for the service to start and for any cached items to be synchronized to the new host.


Error and solution URLS : 

http://netwovenblogs.com/2014/03/11/the-newsfeed-is-not-working-on-mysite-in-sharepoint-2013/

Ref Sites : 

http://almondlabs.com/blog/manage-the-distributed-cache/








Monday, February 2, 2015

Search Service Application creation using Powershell


# Getting  Search Application from Each Server.

$AppServer = get-SPServiceInstance -server VSPIAPP | ?{$_.TypeName -eq "SharePoint Server Search"}
$WEFServer = get-SPServiceInstance -server VSPIWEF | ?{$_.TypeName -eq "SharePoint Server Search"}

#Start our services

Start-SPEnterpriseSearchServiceInstance -Identity $AppServer
Start-SPEnterpriseSearchServiceInstance -Identity $WEFServer

#Create our App Pools

$acct = get-spmanagedaccount "abc\SerchSerivceSVC"
$Admin = new-SPServiceApplicationPool -name "Search_Admin_Pool" -account $Acct
$Query = new-SPServiceApplicationPool -name "Search_Query_Pool" -account $Acct


#Create the Search Service Application

$SA = New-SPEnterpriseSearchServiceApplication -Name "IP Search Service Application" -applicationpool $Admin -databasename "<<Database_Name>>"



#Create the proxy and associate it

$SProxy = new-spenterprisesearchserviceapplicationproxy -name "IP Search Service Application Proxy" -SearchApplication $SA



#Get a clone to work with
$ST = $SA.ActiveTopology.Clone()

#Input each component of the topology into our clone



New-SPEnterpriseSearchAdminComponent -SearchServiceInstance $AppServer -SearchTopology $ST

New-SPEnterpriseSearchContentProcessingComponent -SearchServiceInstance $AppServer -SearchTopology $ST

New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchServiceInstance $AppServer -SearchTopology $ST

New-SPEnterpriseSearchCrawlComponent -SearchServiceInstance $AppServer -SearchTopology $ST


New-SPEnterpriseSearchIndexComponent -SearchServiceInstance $WEFServer -SearchTopology $ST

New-SPEnterpriseSearchQueryProcessingComponent -SearchServiceInstance $WEFServer -SearchTopology $ST

$ST.Activate()


$username = read-host "User name"
$password = read-host -assecurestring  "Password"


Set-SPEnterpriseSearchServiceApplication –Identity $SA -ApplicationPool $Query -DefaultContentAccessAccountName $UserName -DefaultContentAccessAccountPassword $Password.

Friday, January 9, 2015

Using the Synchronization Service in SharePoint 2010 – Forefront Identity Manager 2010/2013

If you use the User Profile Synchronization Service in SharePoint 2010/2013, you may not realise that you are also getting an identity management product included – Forefront Identity Manager 2010/2013 (or FIM 2010). FIM 2010 is a full-featured identity management system, and included with SharePoint 2010 is the basic version that does not have a lot of the “extras” (like Certificate Management, the FIM portal, etc) but is used to import and export data between identity systems. Typically this is SharePoint 2010 User Profiles and Active Directory (other systems are also supported).
To view the FIM 2010 interface you can open the Synchronization Service Manager, which is by default located at:


Sp 2010 :


C:\Program Files\Microsoft Office Servers\14.0\Synchronization Service\UIShell\miisclient.exe


SP 2013 :


C:\Program Files\Microsoft Office Servers\15.0\Synchronization Service\UIShell\miisclient.exe

Tuesday, November 18, 2014

AD Users not getting resolved in People Picker

Issue:- Any New User or Group created in Active Directory is not getting resolved in a specific SharePoint Site collection People Picker. It works fine for other Web Applications and if you create a new Site Collection in the same Web app, People Picker is resolving new Users and Groups there.
For the problematic Site Collection, the old Existing User accounts and Groups are resolving fine, only the New ones are not getting resolved in People Picker.




Resolution:-
Get-SPSite "http://SharePoint/sites/collection" | fl > C:\props.txt
If you open the Props.txt file, you will see the properties for this site collection. Look for "UserAccountDirectoryPath" property. By Default it should be blank, if it is not, that is causing new Users in AD not to be resolved in People Picker.

To Change the Property value to Blank, follow as below.


$Site = Get-SPSite "http://SharePoint/sites/collection"
$Val=""

Saturday, November 8, 2014

Microsoft.SharePoint.SPException

Following is code is working in console application but , it is not working in aspx page.

SPSite site = http://localhost:9292;
    SPSecurity.RunWithElevatedPrivileges(() =>
    {
        SPSiteSubscription subscription = SPSiteSubscription.Create();
       site = webApp.Sites.Add(subscription, siteUrl, title, description, lcid, webTemplate, ownerLogin, ownerName, ownerEmail, null, null, null, useHostHeaderAsSiteName); // exception
       site.AdministrationSiteType = SPAdministrationSiteType.TenantAdministration;
   });

Exception Details : 

Microsoft.SharePoint.SPException: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again. ---> System.Runtime.InteropServices.COMException: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.
at Microsoft.SharePoint.Library.SPRequestInternalClass.SetSiteQuota(String bstrUrl, UInt16 quotaId, Int64 diskQuota, Int64 diskWarning, Int32 userQuota, Double resourceUsageMaximum, Double resourceUsageWarning, Boolean bForSSC)
at Microsoft.SharePoint.Library.SPRequest.SetSiteQuota(String bstrUrl, UInt16 quotaId, Int64 diskQuota, Int64 diskWarning, Int32 userQuota, Double resourceUsageMaximum, Double resourceUsageWarning, Boolean bForSSC)
   --- End of inner exception stack trace ---
at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.SetSiteQuota(String bstrUrl, UInt16 quotaId, Int64 diskQuota, Int64 diskWarning, Int32 userQuota, Double resourceUsageMaximum, Double resourceUsageWarning, Boolean bForSSC) at Microsoft.SharePoint.Administration.SPQuota.Update() at Microsoft.SharePoint.SPSite.set_Quota(SPQuota value) at Microsoft.SharePoint.Administration.SPSiteCollection.Add(SPContentDatabase database, SPSiteSubscription siteSubscription, String siteUrl, String title, String description, UInt32 nLCID, String webTemplate, String ownerLogin, String ownerName, String ownerEmail, String secondaryContactLogin, String secondaryContactName, String secondaryContactEmail, String quotaTemplate, String sscRootWebUrl, Boolean useHostHeaderAsSiteName)   at Microsoft.SharePoint.Administration.SPSiteCollection.Add(SPSiteSubscription siteSubscription, String siteUrl, String title, String description, UInt32 nLCID, String webTemplate, String ownerLogin, String ownerName, String ownerEmail, String secondaryContactLogin, String secondaryContactName, String secondaryContactEmail, Boolean useHostHeaderAsSiteName)    at WSS4WS.ProvisioningService.<>c__DisplayClass5.<CreateSite>b__0() in C:\Projects\Web Services\WSS4WS\WSS4WS\ProvisioningService.asmx.cs:line 77    at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()    at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)    at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)    at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)    at WSS4WS.ProvisioningService.CreateSite(String webApplicationName, String siteUrl, String title, String description, UInt32 lcid, String webTemplate, String ownerLogin, String ownerName, String ownerEmail, Boolean useHostHeaderAsSiteName)
Though the above code snippet works perfectly fine in console application but aspx is webrequest and SharePoint handles web request differently. All the webrequest validated with the FromDigest control. To get rid-off from this error message, we can change the web application validation settings in Central Administration > Web Application General Settings Page.
image
Enjoy this will solve your problem.