Friday, February 26, 2016

The three things you need to know before diving into SharePoint 2016

With the emphasis on Office 365 and a longer than expected release cycle, it's understandable that there were some wondering if SharePoint 2016 would ever arrive. It's now firmly on its way, however, with public previews and a rumored mid-March release date.

read more


by via SharePoint Pro

DynamicPoint’s Integration with Projects and Jobs | New Video!

 In our latest video, we highlight the ability for our SharePoint applications to integrate seamlessly with various Dynamics add-on modules. With DynamicPoint you get the expertise of Business Automation in Expense, Requisition and Invoice Automation coupled with the knowledge of just how Dynamics works based on our exclusive integration to Microsoft Dynamics GP & NAV. Our team knows, understands and configures our applications to integrate with the following:

  • Project Accounting
  • Encore Projects
  • Analytical Accounting
  • Job Tracking
  • Dimensions

The product development approach taken to support these integrations lends itself to being highly flexible as to what Dynamics modules or even custom external databases can be integrated. As opposed to taking the approach of supporting one or the other, a concept of “external categories” has been implemented in all three of DynamicPoint’s products. This strategy enables data to be queried directly from Dynamics and either selected or defaulted on the SharePoint web parts within the Expense, Requisition and Invoice Management Applications. These categories can include such items as projects and cost categories, jobs and tasks or analytical accounting codes and dimensions.

projects-and-jobs-integration3-1024x682

by DynamicPoint

The post DynamicPoint’s Integration with Projects and Jobs | New Video! appeared first on SharePoint Blog.


by Mike Marcin, DynamicPoint via SharePoint Blog

PowerShell PSRemoting error on SharePoint servers

Last week I run into very strange issue, which took me days to figure out and resolve it. It is not directly involved with SharePoint, but it can give you a lot of headache.

As a part of much greater project, one of my tasks was to enable PSRemoting on SharePoint server. The problem was that our clients have SharePoint 2010 on Windows 2008R2 servers, on which PSRemoting is not enabled automatically. So we had to enable PSRemoting on all of these servers. In order to save time, we implemented group policy to enable PSRemoting on all servers. Once implemented, I tried to connect to one of SharePoint 2010 servers, let's call it SPTest, and received following message:

Enter-PSSession -ComputerName SPTest

Enter-PSSession : Connecting to remote server SPTest failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090311 occurred while using Kerberos authentication: There are currently no logon servers available to service the logon request.
Possible causes are:
-The user name or password specified are invalid.
-Kerberos is used when no authentication method and no user name are specified.
-Kerberos accepts domain user names, but not local user names.
-The Service Principal Name (SPN) for the remote computer name and port does not exist.
-The client and remote computers are in different domains and there is no trust between the two domains.
After checking for the above issues, try the following:
-Check the Event Viewer for events related to authentication.
-Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport. Note that computers in the TrustedHosts list might not be authenticated.
-For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic. At line:1 char:1 + Enter-PSSession -ComputerName SPTest

My first thought was that something went wrong with configuring WinRM service on server, because I was able to connect to other, non-SharePoint servers. After manually enabling PSRemoting nothing changed, same error message appeared. I searched Event log on SharePoint server and there was nothing which would indicate what went wrong. Also when I tried Test-WSMan cmdlet it stated that everything is properly configured. Very strange.

After looking in Event Viewer on my client machine, I found following error message:

The Kerberos client received a KRB_AP_ERR_MODIFIED error from the server SPTest$. The target name used was HTTP/SPTest. This indicates that the target server failed to decrypt the ticket provided by the client. This can occur when the target server principal name (SPN) is registered on an account other than the account the target service is using. Ensure that the target SPN is only registered on the account used by the server. This error can also happen if the target service account password is different than what is configured on the Kerberos Key Distribution Center for that target service. Ensure that the service on the server and the KDC are both configured to use the same password. If the server name is not fully qualified, and the target domain (ADTest.COM) is different from the client domain (ADTest.COM), check if there are identically named server accounts in these two domains, or use the fully-qualified name to identify the server.

Ok, this problem has something to do with Kerberos. But what? SPTest machine is joined into domain, and everything is configured properly. How can the ticket be the problem? After consulting Google found this blog: http://ift.tt/1LOq8mf by Damien Caro, where he explained  that, if you have Application pools running under a domain service account, you may run into same issue, since WinRM seems to check for a HTTP SPN set on the computer object (HTTP\name-of-the-server), it will always fail because it will find the HTTP SPN but not set on the computer object. Thus, it cannot authenticate using Kerberos and just fails. It turned out that this is what was causing the problem from the beginning.

I found two solutions for this issue.

First one is quick and dirty, you just have to add one more DNS A record for you machine, or add record to your host file, adding different name for your server with same IP address. For instance, my server name is SPTest, I added in my client machine host file SPTest_PSRemoting with same IP address. After that I tried Enter-PSSession -ComputerName SPTest_PSRemoting and it worked! However, this solution is applicable just for testing purposes, you don't want to add additional DNS record for all of your servers, or hassle with host files.

The other solution is to configure your Service account to utilize SPN  just for ports used by Web applications. This includes typing few commands in command prompt, but be careful, you first need to make a list of all the ports your IIS server is using for Web applications.

First step was to query SPN, I opened command prompt and typed:   

C:\Windows\system32>setspn -Q http/SPTest
Checking domain DC=ADTest,DC=com
CN=SPS_WebApp,OU=Users,DC=ADTest,DC=com
HTTP/SPTEST.ADTest.com
HTTP/SPTEST
HTTP/report
HTTP/reportstaging
HTTP/reporttest
HTTP/reportdev

Existing SPN found!

You can see that Service account SPS_WebApp has SPN HTTP/SPTEST, and since WinRM seems to check for a HTTP SPN set on the computer object (HTTP\SPTEST), it will always fail because it will find the HTTP SPN but not set on the computer object, but on Service account. Thus, it cannot authenticate using Kerberos and just fails.

To get the WinRM Windows Service remote connection to work, narrow the scope of the SPN to the port number for the website. Rather than adding:

HTTP/SPTest.ADTest.com
use
HTTP/SPTest.ADTest.com:80

In this case the services are hosted in the web site running on port 80. The WinRM service runs on port 5195 by default and therefore does not match on the port specific SPN. Rather than specifying port, it is also possible to use the NETBIOS name for the network host if the fully qualified domain name is used for the SPN.

For instance IIS server on my machine uses 3 ports (80,81 and 85) for different Web Applications.

First I had to add SPN which included the ports:

Setspn -S http/SPTest:80 ADTest\SPS_WebApp
Setspn -S http/SPTest.ADtest,com:80 ADTest\SPS_WebApp
Setspn -S http/SPTest:81 ADTest\SPS_WebApp
Setspn -S http/SPTest.ADtest,com:81 ADTest\SPS_WebApp
Setspn -S http/SPTest:85 ADTest\SPS_WebApp
Setspn -S http/SPTest.ADtest,com:85 ADTest\SPS_WebApp

After that, had to delete SPN:

Setspn -D http/SPTest ADTest\SPS_WebApp
Setspn -D http/SPTest.ADtest,com ADTest\SPS_WebApp

And that's it! Once I checked SPN for http/SPtest and received message that no such SPN was found:

C:\Windows\system32>setspn -Q http/SPTest
Checking domain DC=ADTest,DC=com
No such SPN found.

But after querying SPN with explicit port got the following:

C:\Windows\system32>setspn -Q http/SPTest:80
Checking domain DC=ADTest,DC=com
CN=SPS_WebApp,OU=Users,DC=ADTest,DC=com
HTTP/SPTEST.ADTest.com:80
HTTP/SPTEST:80
HTTP/SPTEST.ADTest.com:81
HTTP/SPTEST:81
HTTP/SPTEST.ADTest.com:85
HTTP/SPTEST:85
HTTP/report
HTTP/reportstaging
HTTP/reporttest
HTTP/reportdev

After this intervention I had no more problems with connecting to SharePoint servers.


by Krsto Savic via Everyone's Blog Posts - SharePoint Community

How to do the Batch Search ExecuteQueries in SharePoint 2013 using Client Side Object Model in C#

In one of the Older Article, we saw within a WebPart, how to execute the ExecuteQueries in a Server Side Coding. Now, I met with the same kind of requirement, but the difference is, here I am executing this search from a WebAPI. Already, we saw here how to create a basic WebAPI.
Let me share the piece of code, which is straight forward. Am not explaining this method as it is a Static and does not have any other external dependencies.

private static List GetTopicDocumentCountBatch(TermCollection docTopicsTermCollection, string locationTermID, ClientContext clientContext)
{
//The List of KeywordQuery which will be converted as an Array later
List keywordQueriesList = new List();
//The List of QueryID which will be converted as an Array later
List queryIdsList = new List();
string contentSiteURL = Convert.ToString(ConfigurationManager.AppSettings["ContentSiteURL"]);
Dictionary<string, string> docTopicQueryID = new Dictionary<string, string>();//Framing the Queries
foreach (Term docTopicTerm in docTopicsTermCollection)
{
KeywordQuery keywordQuery = new KeywordQuery(clientContext);
keywordQuery.QueryText = string.Format("(IsDocument:True OR contentclass:STS_ListItem) Tags:#0{0} GVIDoc:[{1}] SPSiteUrl:" + contentSiteURL + " (ContentTypeId:0x010100458DCE3990BC4C658D4AB1D0CA3B9782* OR ContentTypeId:0x0120D520A808* OR ContentType:GVIarticle)", locationTermID, docTopicTerm.Name); ;
keywordQuery.IgnoreSafeQueryPropertiesTemplateUrl = true;
keywordQuery.SelectProperties.Add("ContentType");
keywordQuery.SelectProperties.Add("ContentTypeId");
keywordQuery.SelectProperties.Add("GVIDoc");
keywordQuery.SourceId = Guid.NewGuid();
keywordQueriesList.Add(keywordQuery);
queryIdsList.Add(Convert.ToString(keywordQuery.SourceId));
docTopicQueryID.Add(Convert.ToString(keywordQuery.SourceId), docTopicTerm.Name);
}
//Convert the KeywordQuery and QueryID into array,
KeywordQuery[] keywordQueries = keywordQueriesList.ToArray();
string[] queryIds = queryIdsList.ToArray();
//Initialize the SearchExecutor
SearchExecutor searchExecutor = new SearchExecutor(clientContext);
//Actual use of ExecuteQueries method
var results = searchExecutor.ExecuteQueries(queryIds, keywordQueries, false);
clientContext.ExecuteQuery();
//Iterating the Result Set.
List docTopicsList = new List();
if (results.Value.Count > 0)
{
foreach (var result in results.Value)
{
if (result.Value[0].ResultRows.Count() > 0)
{
DocTopic docTopic = new DocTopic();docTopic.Title = Convert.ToString(docTopicQueryID[result.Key]);
docTopic.Url = "[" + docTopic.Title + "]";
docTopic.TotalCount = result.Value[0].ResultRows.Count();
docTopic.VideoCount = Convert.ToString(result.Value[0].ResultRows.SelectMany(m => m).Where(k => k.Key.Equals("ContentTypeId")).Select(m => m.Value).Where(y => y.ToString().Contains("0x0120D520A808")).Count());
docTopic.ArticleCount = Convert.ToString(result.Value[0].ResultRows.SelectMany(m => m).Where(k => k.Key.Equals("ContentType")).Select(m => m.Value).Where(y => y.ToString().Contains("GVIarticle")).Count());
docTopic.DocumentCount = Convert.ToString(result.Value[0].ResultRows.SelectMany(m => m).Where(k => k.Key.Equals("ContentTypeId")).Select(m => m.Value).Where(y => y.ToString().Contains("0x010100458DCE3990BC4C658D4AB1D0CA3B9782")).Count());

docTopicsList.Add(docTopic);
}
}
}
return docTopicsList;

}

Happy Coding,
Sathish Nadarajan.


by Sathish Nadarajan via Everyone's Blog Posts - SharePoint Community

Thursday, February 25, 2016

Expense Management for External Users

Does your organization have situations where people submit expense reports to obtain reimbursement but are not employees within the company itself?  At DynamicPoint, we have seen this situation come up in the case of volunteers, vendors, partners or other supporting staff that are incurring business expenses on a company’s behalf. Read more about how DynamicPoint’s Expense Management application enables external users to access an intuitive SharePoint based expense report that is securely accessible to outside resources.

Plus: see our case study on how a Global Professional Association streamlines expense reporting for volunteers and employees by leveraging the benefits of SharePoint Forms Based Authentication and DynamicPoint’s Expense Management solution!

external-user-workflow1-1080x628

by Dynamic Point

The post Expense Management for External Users appeared first on SharePoint Blog.


by Mike Marcin, DynamicPoint via SharePoint Blog

Wednesday, February 24, 2016

SharePoint 2016: What Is in a Patch?

We're all familiar with patches and what they entail, but in SharePoint 2016 the model is changing significantly. In this story we will detail the changes--and examine what patches will be composed of moving forward.

read more


by via SharePoint Pro

How to Read/Import Excel Sheet in SharePoint List using SPServices and JQuery.

Recently I passed through an interesting requirement, had to import Excel sheet in SharePoint List.

Let’s Check how does it works.

For any demonstration I use my favorite web part Script Editor with lovely SPServices and JQuery

1. First Add a Custom List named it ExcelImport.

2. Create five Columns to the ExcelImport List.

First Name (Rename of Title Column), LastName, Position, Location, Country.

3. Now Next step is to add Script Editor Web Part to page.

4. Add Reference of SPServices and JQuery in Script Editor.

  (For frequent use I would suggest you to add reference in your master page)

5. Paste the below code in Script Editor.

<script src="Your JQuery Reference URL"></script>
<script src="Your SPServices Reference URL"></script>
<script>
var excel;
function GetData(cell,row){
if (window.ActiveXObject) {
try {
excel = new ActiveXObject("Excel.Application");
}
catch (e) {
alert (e.message);
}
}
else {
alert ("Opss... inconvenience caused is deeply regretted. Kindly Upload from IE");// Only work in IE Browser
return;
}

var excel_file = excel.Workbooks.Open("D:\MyExcelSheetName.xlsx");//Read excel from D drive by MyExcelSheetName Name
var sht = excel.Worksheets("Sheet1"); // Reading Sheet1 from Worksheets

for(var i=5; i<i+1; i++){ // will start reading data from 5th row
var FirstName = sht.Cells(i,3).Value; // Start reading First Name from 3rd cell
var LastName = sht.Cells(i,5).Value; // Start reading Last Name from 5th cell
var Position = sht.Cells(i,7).Value; // Start reading Position from 7th cell
var Location = sht.Cells(i,9).value; // Start reading Location from 9th cell
var Country = sht.Cells(i,11).Value; //Start reading Country from 11th cell

if (FirstName == undefined || LastName == undefined || Position == undefined || Location == undefined || Country == undefined){ // will stop reading data when excel data end.
break;
}
$().SPServices({
operation: "UpdateListItems",
webURL: _spPageContextInfo.webAbsoluteUrl,
async: false,
batchCmd: "New",
listName: "ExcelImport",
valuepairs: [["Title",FirstName],["LastName",LastName],["Position",Position],["Location",Location],["Country",Country]],
completefunc: function(xData,status){
}
});
}
alert("Data Imported");
excel_file.Close();

}

$(document).ready(function(){
$("#btnload").click(function(){
GetData(1,1);
});
});
</script>
<input type="button" style="float: left;" id="btnload" value="Import Excel"/>

6.Create your Excel file and save it to your D drive by  MyExcelSheetName.xlsx name.

Make sure your Excel Sheet must be in below format if you are using exactly above code.

7. Click on Import Excel button from your page. And your List will be updated with desired result.

Note : If you are getting Error like “Automation server can't create object

Enable Allow ActiveX filtering.

8. Verify your List.


Cheers ...

Thanks.


by Amir Reza via Everyone's Blog Posts - SharePoint Community