Archive for ‘Share Point 2013’

October 27, 2016

Error: “execution of scripts is disabled on this system”

When you try to execute a SharePoint Online PowerShell command you may come across the above error. Its due to some privacy settings in your local computer.

These scripts could potentially harmful things that you will never expect. 🙂  By default the execution of the PowerShell scripts are disabled by Microsoft. As well as before executing a script you have to make sure that the script is from a reliable source.

To over come the above error you just need to change the Execution policy on your computer using a simple Powershell command as below:

Set-ExecutionPolicy RemoteSigned

when you are done with the above you can execute the script without any issue. Once its done its safe to make the settings to the default as below:

Set-ExecutionPolicy Restricted

You can change the RemoteSigned portion of the command to any of the options as below:

Restricted – No scripts can be run. Windows PowerShell can be used only in interactive mode (This is the default).
AllSigned – Only scripts signed by a trusted publisher can be run.
RemoteSigned – Downloaded scripts must be signed by a trusted publisher before they can be run.
Unrestricted – No restrictions; all Windows PowerShell scripts can be run.

March 3, 2015

The Datasheet view of this list cannot be displayed.

When you get the below error while viewing a list view data :

The Datasheet view of this list cannot be displayed. Please wait while the page is redirected to Standard view. If your list does not appear in a few moments, open the list in Standard view.

err

Install the 2007 Office System Driver: Data Connectivity Components from the link.

October 30, 2014

Alternate languages are not supported on sites with customized CSS files

I had a site with variation for English and Arabic. I had no problem changing the language from Arabic to English and vice versa in our staging environment. For En and Ar subsite even was able to change the language without any issue.

But in production environment the case was so strange. I can be able to change the language in subsites (ex: for en and ar subsites) but not for the root site. When i try to do so was getting the error “Alternate languages are not supported on sites with customized CSS files.” Tried on searching in log files and couldn’t find any clue to sort out this issue.

One of the solution that i come across when searching was to delete the “_style” folder under root. I removed the folder and the situatoin was the same. I thought it was the problem with the Arabic Language pack. I tried repairing the Arabic Lanuage pack. Though it didnt work.

Finally the solution is to remove the entry from the table “AllWebs” for the “CustomizedCSS” field for the root site.

  1. Connect to SQL Server using SQL Server Management Studio
  2. Open the “AllWebs” Table
  3. You will find 3 entries in this particular table for Root, English and Arabic Sites.
    When you check the CustomizedCSS for all these 3 records you will find some value for the root site record (in my case it was showing the ;#corei5; value) and for the other two you will find NULL value.
  4. Set the value for NULL for that.
  5. Once its done you can be able to change the language to Arabic without any issue.
October 30, 2014

Adding dynamic CSS link to Sharepoint MasterPage

In a situation where you have to load CSS files based on the current culture, in this situation you have to use the ~language variable in SharePoint. This will retrieve the proper language ID(example for English-US: en-US, Arabic-SA: ar-SA).

<link rel="stylesheet" href="<%$SPUrl:~sitecollection/_catalogs/masterpage/en-us/css/mystyle.css %>" />

In your master page HTML layout you can add the snippet as below:

<!--SPM:<asp:Literal runat="server" Text="<link rel='stylesheet' href='"/>-->
        <!--SPM:<asp:Literal runat="server" Text="<% $SPUrl:~sitecollection/_catalogs/masterpage/~language/css/mystyle.css %>"/>-->
        <!--SPM:<asp:Literal runat="server" Text="' type='stylesheet' />"/>-->

When using CSSRegistration can use the following snippet:

expected link URL :

<SharePoint:CssRegistration name=”<% $SPUrl:/_layouts/projectname/styles/~language/master.css %>” runat=”server”/>

Master page html page :

<!--SPM:<SharePoint:CssRegistration name="&lt;% $SPUrl:~site/_catalogs/masterpage/test/style.css %&gt;" runat="server" after="SharepointCssFile" />-->
<!--SPM:<SharePoint:CssRegistration name="&lt;% $SPUrl:~site/_catalogs/masterpage/test/style.css %&gt;" runat="server" after="SharepointCssFile" />-->
April 23, 2014

SharePoint Designer: The file is no longer checked out or has been deleted

While you were working with SharePoint designer 2013 you might face a situation where you will popup with an error “The file is no longer checked out or has been deleted” at a time when you try to check in any of the file from SharePoint designer. I tried restarting the SharePoint designer, resetting the IIS and restarting the machine even.

no longer checkout

Finally it seems that need to clear the cache in local app storage to resolve the above error.

Navigate to your local app settings cache folder located in the below location and delete the files corresponding to your site.

For ex: C:\Users\Ammar\AppData\Local\Microsoft\WebsiteCache (my local machine path)

March 13, 2014

Moving SharePoint 2013 Sites, Central Administration Console from one SQL Server to another SQL server

Please follow below steps in moving the SharePoint database from one server to another.

    1. Stop all the processes that might be accessing your SharePoint databasesFor ex:
      • SharePoint 2010 Administration
      • SharePoint 2010 Timer
      • SharePoint 2010 Tracing
      • SharePoint 2010 User Code Host
      • SharePoint 2010 VSS Writer
      • SharePoint Foundation Search V4
      • World Wide Web Publishing Service
      • SharePoint Server Search 14
      • Web Analytics Data Processing Service
      • Web Analytics Web Service


      runningservices

    2. Back up all your SharePoint databases on SQL Server A (this is in any case if anything
      went wrong).
    3. Deattach all your databases from SQL Server A.


deattache

    1. Move all the .mdf and .ldf file from SQL Server A to SQL Server B.
    2. Place them in the proper DATA folder on SQL Server B.
    3. Make sure the same structure of user accounts with proper privileges that was on
      SQL Server A to be created on SQL Server B.
    4. Then attach the databases on SQL Server B.


attach

    1. Modify the SQL alias on SharePoint that points SQL Server A to SQL Server B.


sqlclientutility

while i was detaching some of the databases was getting the error saying (Cannot detach the database ‘DEMO’ because it is currently in use.) that still some users are connected to the database. To get rid of that problem, executed the following SQL statements:

–Kick all users off of the database NOW
ALTER DATABASE YourDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE

–Kick all but after 60 seconds
ALTER DATABASE YourDatabase SET SINGLE_USER WITH ROLLBACK AFTER 60 SECONDS

–restore connection to users
ALTER DATABASE YourDatabase SET MULTI_USER

January 7, 2014

Apps for SharePoint 2013

When I was setting up the SharePoint Apps environment in one of our client site, I have followed the below article to configure the same:

https://www.nothingbutsharepoint.com/

upong configuring the apps successfully the administrator of the SharePoint site can be able to navigate to SharePoint online store and can add the same to the site even. Even though when accessing the added SharePoint app it doesn’t display the app instead its getting crashed.

The redirection happens as below with the instance id of the SharePoint apps as below:

http://abcportal.efg.com.co/etc/_layouts/15/appredirect.aspx?instance_id=a72b7806%2Dca1a%2D41c7%2D974e%2D6f7145def00c

As the two applications (SharePoint site and the apps site) are not running under same domain, seems the IIS having problem with redirecting to the other application (SharePoint apps).

when i went through the logs was able to find the below related to the two apps added in the site:

Doing appredirect from appredirect.aspx: in site: 8308f31c-8e95-4bb2-ac5d-bfc6032efe2d with 302 redirect to: http://apps-a859967b8e5983.ETCApps.com/etc/ArtezioSPPhotoWallInstagram/Pages/Default.aspx?SPHostUrl=http%3A%2F%2Fcoeportal%2Eetc%2Eedu%2Fetc&SPLanguage=en%2DUS&SPClientTag=6&SPProductNumber=15%2E0%2E4551%2E1001&SPAppWebUrl=http%3A%2F%2Fapps%2Da859967b8e5983%2EETCApps%2Ecom%2Fetc%2FArtezioSPPhotoWallInstagram

Doing appredirect from appredirect.aspx: in site: 8be20238-f1a2-43c3-9d83-535554a7e4d0 with 302 redirect to: http://apps-a859967b8e5988.ETCApps.com/GoogleSearchApp/Pages/GoogleSearchWebpart.aspx?SPHostUrl=http%3A%2F%2Fcoeportal%2Eetc%2Eedu&SPLanguage=en%2DUS&SPClientTag=33&SPProductNumber=15%2E0%2E4551%2E1001&SPAppWebUrl=http%3A%2F%2Fapps%2Da859967b8e5988%2EETCApps%2Ecom%2FGoogleSearchApp

So finally there was a resolution to the above. the Resolution is to create a new SharePoint web application with the empty host header. Once its done the apps started to work without any further headache. 🙂

References:

http://social.technet.microsoft.com

http://absolute-sharepoint.com/

December 20, 2013

SharePoint 2013 My Newsfeed ‘Everyone’ Internal error code 55

I came across an error in Share Point News Feeds. When I clicked on ‘Everyone’ in the My newsfeed. The following error occurred:

sharepointfeed_error_1I had to give the service account that is running the User Profile Service application pool full control permissions for the User Profile Service Application.

Follow the below steps:

SharePoint Central Administration–> Application Management–> Manage service Applications

In Service applications Page, select User profile service application–> select permissions in the top ribbon

sharepoint_Feed_error_3

Assign full permissions for the account used to run User profile service application

sharepoint_Feed_error_2Upon following the steps above the feeds started to work as usual. 🙂

December 8, 2013

SQL Database State stuck in Restoring

Suddenly one of the production SharePoint site in one of our client site was down. When tried to browse the site was getting the error “Cannot connect to the configuration database. So i logged into the database server and was able to see the following: probsOne of the database was get stucked in the restoring mode. The rest of the databases was in the mode of restoring. I was waiting for more than one hour to let the restoring process get finish and unfortunately nothing happened. 😦

So the resolution is to:

Execute the following command in any case if your database get stucked at the time of restoring:

RESTORE DATABASE [DATABASENAME] WITH RECOVERY;

Once i execute the above i was getting the following error:

Msg 3104, Level 16, State 1, Line 1
RESTORE cannot operate on database ‘kiainternet01’ because it is configured for database mirroring. Use ALTER DATABASE to remove mirroring if you intend to restore the database.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

i didn’t aware the above database is configured for mirroring. So i had to switch off the mirroring temporarily using the following command:

ALTER DATABASE [DATABASENAME] SET PARTNER OFF;

upon that executed the following command:

RESTORE DATABASE [DATABASENAME] WITH RECOVERY;

finally the databases were online :

final

November 3, 2013

Hide root node of the Sharepoint 2013 SiteMapPath

I had my sitemap path with following link in the master page.

Home > Portal Site > Departments >HR

Home link redirects me to the variationroot.aspx at the same time the “Portal site” also links with the default.aspx page. Anyhow the variationroot.aspx page will redirect the user to the same Default.aspx page. So needs to remove this redundant links and finally the site map path links should appear as below:

Portal Site > Departments >HR

Add the following CSS entry in any case if you wanted to hide the first node of the sitemappath in a variation enabled sharepoitn site.

<asp:SiteMapPath ID="contentNavigation" runat="server">
    <RootNodeTemplate>
    </RootNodeTemplate>
</asp:SiteMapPath>
#ctl00_contentNavigation span:nth-child(2),span:nth-child(3)
{
    display:none;
}
October 27, 2013

SQL Server Client Network Utitily

If you are working with a number of SQL Server instances or have really complex server/instance names, its good to use aliases with easy naming conventions. The same can be used to connect to SQL Server instancess. For you to create these aliases you can use the SQL Server Client Network utitily programs (cliconfg). Aliases would secure the real instance names of the SQL Server in any case if its exploited by an external hacker.

cliconfg

Launch “cliconfg” by Start > Run > CliConfg. Then go to Alias tab and click the add button to add the alias.

October 27, 2013

AppFabric installation failed because installed MSI returned with error code: 1603

I was getting the below error at the time of running the pre-requistes for a fresh installation of Sharepoint 2013 and SQL Server 2012. Rest of the prerequisites are getting installed without any problem but only the app fabric instllation getting failed. When i check the logs (AppServerSetup1_1_CustomActions(2013-10-27 11-09-45).log) located under path C:\Users\<username>\AppData\Local\Temp and was able to find the below:

27/10/2013 10:38:47 EXEPATH=powershell.exe PARAMS=-command “$content = Get-Content \”c:\Program Files\AppFabric 1.1 for Windows Server\\AppFabricServer.xml\”; $content = ForEach-Object -InputObject $content { $_ -replace \”INSTALLPATH\”, \”c:\Program Files\AppFabric 1.1 for Windows Server\\\” }; Set-Content -value $content -path \”c:\Program Files\AppFabric 1.1 for Windows Server\\AppFabricServer.xml\” ” LOGFILE=C:\Users\mssadmin\AppData\Local\Temp\AppServerSetup1_1_CustomActions(2013-10-27 10-38-40).log
ExitCode=0
27/10/2013 10:38:48 EXEPATH=powershell.exe PARAMS=-command “$content = Get-Content \”c:\Program Files\AppFabric 1.1 for Windows Server\\Consolidator.xml\”; $content = ForEach-Object -InputObject $content { $_ -replace \”INSTALLPATH\”, \”c:\Program Files\AppFabric 1.1 for Windows Server\\\” }; Set-Content -value $content -path \”c:\Program Files\AppFabric 1.1 for Windows Server\\Consolidator.xml\” ” LOGFILE=C:\Users\mssadmin\AppData\Local\Temp\AppServerSetup1_1_CustomActions(2013-10-27 10-38-40).log
ExitCode=0
Executing action : Microsoft.ApplicationServer.InstallHelper.SQMTaskInstallAction
SQMTaskInstall areguments –  /create /tn “\Microsoft\Windows\AppFabric\Customer Experience Improvement Program\Consolidator” /xml “c:\Program Files\AppFabric 1.1 for Windows Server\Consolidator.xml”
Output: SUCCESS: The scheduled task “\Microsoft\Windows\AppFabric\Customer Experience Improvement Program\Consolidator” has successfully been created.
27/10/2013 10:38:50 EXEPATH=c:\Windows\system32\\sc.exe PARAMS=privs AppFabricCachingService SeChangeNotifyPrivilege LOGFILE=C:\Users\mssadmin\AppData\Local\Temp\AppServerSetup1_1_CustomActions(2013-10-27 10-38-40).log
Output: [SC] ChangeServiceConfig2 SUCCESS
ExitCode=0
27/10/2013 10:38:50 EXEPATH=c:\Windows\system32\\sc.exe PARAMS=sidtype AppFabricCachingService unrestricted LOGFILE=C:\Users\mssadmin\AppData\Local\Temp\AppServerSetup1_1_CustomActions(2013-10-27 10-38-40).log
Output: [SC] ChangeServiceConfig2 SUCCESS
ExitCode=0
27/10/2013 10:38:50 EXEPATH=c:\Windows\system32\\netsh.exe PARAMS=advfirewall firewall add rule enable=no profile=any dir=in action=allow description=”@c:\Program Files\AppFabric 1.1 for Windows Server\ApplicationServerResources.dll,-203″ name=”@c:\Program Files\AppFabric 1.1 for Windows Server\ApplicationServerResources.dll,-202″ protocol=TCP program=”c:\Program Files\AppFabric 1.1 for Windows Server\DistributedCacheService.exe” LOGFILE=C:\Users\mssadmin\AppData\Local\Temp\AppServerSetup1_1_CustomActions(2013-10-27 10-38-40).log
Output: Ok.
ExitCode=0
27/10/2013 10:38:51 EXEPATH=c:\Windows\system32\\netsh.exe PARAMS=advfirewall firewall add rule enable=no profile=any dir=out action=allow description=”@c:\Program Files\AppFabric 1.1 for Windows Server\ApplicationServerResources.dll,-207″ name=”@c:\Program Files\AppFabric 1.1 for Windows Server\ApplicationServerResources.dll,-206″ protocol=TCP program=”c:\Program Files\AppFabric 1.1 for Windows Server\DistributedCacheService.exe” LOGFILE=C:\Users\mssadmin\AppData\Local\Temp\AppServerSetup1_1_CustomActions(2013-10-27 10-38-40).log
Output: Ok.
ExitCode=0
Executing action : Microsoft.ApplicationServer.InstallHelper.FirewallExceptionAction
27/10/2013 10:38:51 EXEPATH=powershell.exe PARAMS=-command “$str = [System.Environment]::GetEnvironmentVariable(\”PSModulePath\”, [System.EnvironmentVariableTarget]::Machine); $str = $str+\”;c:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules\”; c:\Windows\system32\setx.exe /M PSModulePath \”$str\”” LOGFILE=C:\Users\mssadmin\AppData\Local\Temp\AppServerSetup1_1_CustomActions(2013-10-27 10-38-40).log
Error: ERROR: Invalid syntax. Default option is not allowed more than ‘2’ time(s).
Error: Type “SETX /?” for usage.
ExitCode=1
27/10/2013 10:38:54 EXEPATH=c:\Windows\system32\\netsh.exe PARAMS=advfirewall firewall delete rule name=”@c:\Program Files\AppFabric 1.1 for Windows Server\ApplicationServerResources.dll,-206″ LOGFILE=C:\Users\mssadmin\AppData\Local\Temp\AppServerSetup1_1_CustomActions(2013-10-27 10-38-40).log
Output: Deleted 1 rule(s).
Output: Ok.
ExitCode=0
27/10/2013 10:38:54 EXEPATH=c:\Windows\system32\\netsh.exe PARAMS=advfirewall firewall delete rule name=”@c:\Program Files\AppFabric 1.1 for Windows Server\ApplicationServerResources.dll,-202″ LOGFILE=C:\Users\mssadmin\AppData\Local\Temp\AppServerSetup1_1_CustomActions(2013-10-27 10-38-40).log
Output: Deleted 1 rule(s).
Output: Ok.
ExitCode=0
Executing action : Microsoft.ApplicationServer.InstallHelper.SQMTaskUninstallAction
Output: SUCCESS: The scheduled task “\Microsoft\Windows\AppFabric\Customer Experience Improvement Program\Consolidator” was successfully deleted.

based on the above error log could notice that ” is getting amended to the PSModulePath path. So for this what you have to do is to remove that ” from the PSModulePath enviornmentabl variable.

envvvariable

references:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/8cf55972-e441-4107-8c0d-1692ad03213d/error-with-installation-of-appfabric-11-on-psmodulepath?forum=velocity

http://social.msdn.microsoft.com/Forums/sharepoint/ja-JP/290ff740-d8f1-426c-b7f0-1152dc481779/appfabric-installation-failed-because-installer-msi-returned-with-error-code-1603?forum=sharepointgeneralprevious

http://social.msdn.microsoft.com/Forums/vstudio/en-US/8338a53e-6b4f-44a8-ac7b-a287f3b4b20e/installation-problem-msi-error-1603-win-7-x64-appfabric-11?forum=velocity

http://support.microsoft.com/kb/310519/en-us

October 9, 2013

Activating and Deactivating Features using PowerShell

Installing a feature:

Install-SPFeature FeatureFolderName

To activate a feature:

Enable-SPFeature FeatureFolderName -Url http://server/site/

To deactivate a feature:

Disable-SPFeature FeatureFolderName -Url http://server/site/

To uninstall a feature:

Uninstall-SPFeature FeatureFolderName
October 4, 2013

Hiding the ribbon – SharePoint 2013

Add the following code to hide the ribbon in Share Point 2013.

<SharePoint:SPSecurityTrimmedControl PermissionsString="FullMask" runat="server">
<div id="ms-designer-ribbon">
<!--SID:02 {Ribbon}-->
<!--PS: Start of READ-ONLY PREVIEW (do not modify) --><div class="DefaultContentBlock" style="background:rgb(0, 114, 198); color:white; width:100%; padding:8px; height:64px; overflow:hidden;">
In true previews of your site, the SharePoint ribbon will be
here.</div><!--PE: End of READ-ONLY PREVIEW -->
</div>
</SharePoint:SPSecurityTrimmedControl> 

Once you apply the above code snippet the vertical bar would be get hidden.  For you to get the ribbon back, you have to over ride the style attribute of the body, so for that add the attribute to the style=”overflow: scroll !important” to the BODY element of your master page. Once you apply the same you will get the vertical scroll bar back. The reason behind this is that the master pages have a link to corev15.css. This stylesheet sets overflow to hidden for the BODY element, which removes the scroll bar.

more about the SPSecurityTrimmedControl you can find it in the below link : http://msdn.microsoft.com/en-us/library/jj822366.aspx

October 1, 2013

Restore-SPSite : 0x80070003

I was restoring a SharePoint site from a lab environment to Production.  This is one of the frequently used powershell commands that we use in addition to the Backup-SPSite.

Restore-SPSite http://ggvstg01:12160/discussionforum/GeneralDiscussi

-Path C:\Users\user\Desktop\Backup\GeneralDiscussion.bak –Force

Come on man, was worried to see the below error.

**Restore-SPSite : 
<nativehr>0x80070003</nativehr>
<nativestack></nativestack>
At line:1 char:1
2

So started to search on this error hence this is the first time I saw this error. Some posts says its related to managed path issue, advice us to check the managed path in both the environments. I checked, so in my case its nothing to do with the managed paths Hence the site had only one root site collection. In some post it says the SharePoint versions are different. I thought this might be correct hence in my lab environment it was the SharePoint enterprise version with the trial license. But in production it was the SharePoint Enterprise. Suddenly I thought of checking the SharePoint logs and the event viewer. I couldn’t see any specific error in the Share Point logs. Then moved to check on the Event Viewer. Ohhhh man, it was something related to the login which I used to execute the power shell command “insufficient SQL Database permission for user named domainaame\username”.

3

Finally logged into the SQL Server and applied the above said user the “sysadmin”permission and executed the restore command without any issue. 😀

July 14, 2013

The dilemma of Double-Hop Dogma

Was wondering about the subject of the post which i am going to write. okay fine and its Double Hop Dogma. This is related to Exchange Web Services API. you can download the API from this link. Let me explain what happened. There was a requirement raised due to the fact that we cant view OWA websites (Outlook Webmail) inside an IFRAME. When we used the OWAInputWebPart the owa site used to display within the ifram of the OWAInputWebPart. Hence there was an exception saying that it cannot be displayed within IFRAME. So as a solution we had to develop our own custom web part to view the inbox emails.

Initially i was playing around with a single mail box and was able to fetch the mails without any problem. I refered this MSDN article for my reference.

binding.Credentials = new NetworkCredential("userid", "password", "domain");

So the above code works fine and was able to read the emails. As the next step the requirement was to read the emails based on the currently logged in user in Share Point. So started working on a new web part for this.

as per the link it says that…

If you want to connect to EWS from a computer that is logged on to the domain, using the credentials of the authenticated user, set the UseDefaultCredentials property on the ExchangeService object to true.

// Connect by using the default credentials of the authenticated user.
service.UseDefaultCredentials = true;

i kept trying the above code to work but unfortunately it didn’t work. I spent full whole day trying on this. I searched on the web and found the blog post about the double hop dogma. it says “The user who’s browsing the application from a client machine passes his credentials to the IIS server, i.e. the credentials of the user hop from the client to the IIS server. Subsequent to that, when the IIS application executes EWS calls, it is supposed to pass those same credentials to the Exchange server, to authenticate the logged on user. This works fine in the ideal scenario, and falters in alternative scenarios.”

They have mentioned following scenarios related to the above sentence as below:

Ideal scenario: Kerberos authentication method is being used within the organization
Frequent Scenarios: The non-ideal scenario is not being observed, i.e. NTLM might be the active authentication mechanism, or Kerberos could be failing and the application falls back on attempting authentication via NTLM which would eventually fail in a double-hop situation.”

In my case when i checked the active directory structure on the client site, i learnt that they are not using the Kebreros authentication instead they are using the NTLM authentication on AD.

So i came across the blog post : Need a way to authenticate to Exchange Web Services and based on the fact which explains that: “Create a service account that has either impersonation rights or delegate access over the employee mailboxes. Then log in as the service account.” I advised the network administrator to create a service account for me. Uplon creating the account i resumed my work as usual.

// Setup connection string
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
service.Credentials = new NetworkCredential("superadmin", "password", "domain");

Impersonating the service using a difference user id.

// Impersonation
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "useremail1@domain.com");

In this place i was able to get the currently logged in user by executing the following code

HttpContext.Current.User.Identity.Name.ToString()

Finally was able to retrieve mail details as below:

SearchFilter searchFilter = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));

var inbox = new FolderId(WellKnownFolderName.Inbox);
var iv = new ItemView(9999);

FindItemsResults<Item> findResults = service.FindItems(inbox, searchFilter, iv);

if (findResults.Items.Count > 0)
{
foreach (Item item in findResults.Items)
{
mailboxDetails a = new mailboxDetails();
a.Subject = item.Subject;
}
}

Refer example post here by Jens Willmer.

Please refer the following articles to understand about Exchange Impersonation:

Delegate Access with Exchange Web Services

Exchange Impersonation vs. Delegate Access

The thread i posted on MSDN

Threads which was posted by others:

Exchange Web Services (EWS), GetItem() call produces AccessDenied error

ServiceRequestException Message : Request failed. The remote server returned an error: (401) Unauthorized

Exchange Web Services: UseDefaultCredentials property

please refer some samples related to the Exchange Web Services through this link.

Exchange Tutorial Part 1 – Impresonated Exchange Service Binding

June 17, 2013

Remove “View All Site Content” link from quick launch – Sharepoint 2013

if you want to remove the “View All Site Content” link from the quick launch navigation, just comment out the following code from your master page.

<hr /><SharePoint:ClusteredSPLinkButton ID="idNavLinkViewAllV4" runat="server" Permissions="ViewFormPages" NavigateUrl="~site/{0}/viewlsts.aspx" Text="&lt;%$Resources:wss,quiklnch_allcontent_short%&gt;" accesskey="&lt;%$Resources:wss,quiklnch_allcontent_AK%&gt;" CssClass="ms-core-listMenu-item" />