Friday, June 26, 2015

How to download files from a SharePoint document library remotely via Lists.asmx webservice



Below I am giving a sample c# code for a .Net Console application, to download the files from a SharePoint Document Library remotely via Lists.asmx web service. We can use the same code for both SharePoint V2 and V3. Basically the application is consuming Lists.asmx web service which is available in the /_Vti_Bin/ location of the site and we can use GetListItems() method for returning the information about document library items as XML.
XmlNode ndListItems = objLists.GetListItems("Shared Documents", null, ndQuery, ndViewFields,null, ndQueryOptions, null);
Using XmlNodeReader we can iterate through each nodes of XML tree and can find out the absolute URL and name of each document library items. For seing the whole XML tree we can use one OuterXml Property of the XmlNode (ndListItems.OuterXml), It will show the all nodes and its childs.
objReader ["ows_EncodedAbsUrl"] will give the URL and objReader ["ows_LinkFilename"] will give the name of the document library item. Once if we get the URL we can download that item to our local machine by using HttpWebRequest & HttpWebResponse classes. We will get the response steam by using the method GetResponseStream(), from this stream we can read the content to a byte array and we can write those byte stream to a physical file location using a FileStream Class.
CODE SNIPPET :
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
using System.Xml;
using System.Xml.XPath;
using SiteDataWebService;
namespace SiteDataWebService
{
class Program
{
public static void DownLoadAttachment(string strURL,string strFileName)
{
HttpWebRequest request;
HttpWebResponse response = null;
try
{
request = (HttpWebRequest)WebRequest.Create(strURL);
request.Credentials = System.Net.CredentialCache.DefaultCredentials;
request.Timeout = 10000;
request.AllowWriteStreamBuffering = false;
response = (HttpWebResponse)request.GetResponse();
Stream s = response.GetResponseStream();
//Write to disk
FileStream fs = new FileStream(@"C:\DownLoads\"+strFileName, FileMode.Create);
byte[] read = new byte[256];
int count = s.Read(read, 0, read.Length);
while (count > 0)
{
fs.Write(read, 0, count);
count = s.Read(read, 0, read.Length);
}
//Close everything
fs.Close();
s.Close();
response.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);}
}
static void Main(string[] args)
{
XmlDocument resdoc = new System.Xml.XmlDocument();
XmlNode resnode = null;
string strURL = "";
string strFileName = "";
try
{
ListsService.Lists objLists = new SiteDataWebService.ListsService.Lists();
objLists.Credentials = System.Net.CredentialCache.DefaultCredentials;
objLists.Url = "http://[SITENAME]:34028/sites/TestSite/_vti_bin/lists.asmx"; // change the URL to your sharepoint site
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");
XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields","");
XmlNode ndQueryOptions = xmlDoc.CreateNode(XmlNodeType.Element,"QueryOptions", "");
ndQueryOptions.InnerXml ="<IncludeAttachmentUrls>TRUE</IncludeAttachmentUrls>";
ndViewFields.InnerXml = "";
ndQuery.InnerXml = "";
try
{
XmlNode ndListItems = objLists.GetListItems("Shared Documents", null, ndQuery, ndViewFields, null, ndQueryOptions, null); // you can change the document library name to your custom document library name
XmlNodeList oNodes = ndListItems.ChildNodes;
foreach (XmlNode node in oNodes)
{
XmlNodeReader objReader = new XmlNodeReader(node);
while(objReader.Read())
{
if (objReader["ows_EncodedAbsUrl"] != null && objReader["ows_LinkFilename"]!=null)
{
strURL = objReader["ows_EncodedAbsUrl"].ToString();
strFileName = objReader["ows_LinkFilename"].ToString();
DownLoadAttachment(strURL,strFileName);
}
}
}
Console.ReadLine();
}
catch (System.Web.Services.Protocols.SoapException ex)
{
Console.WriteLine("Message:\n" + ex.Message + "\nDetail:\n" + ex.Detail.InnerText +"\nStackTrace:\n" + ex.StackTrace);
Console.ReadLine();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
EXCEPTIONS : Below I am listing some of exceptions may occur if we forgot to do something
Exception 1:
Message: {"Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown."}
Cause: This exception may occur if the document library name is incorrect
Exception 2:
Message: {"The request failed with HTTP status 404: Not Found."}
Cause: This exception may occur if the Site URL is incorrect
Exception 3:
Message : {"Access denied to the path..."}
Cause : Access permissions to the physical folder for writing the files

Upload file in document library with metadata including lookup field using sharepoint web service

ssue
When we try to upload document (especially pdf) with metadata association to sharepoint document library using CopyIntoItems method of Copy webservice. Then it works great for upload & association of metadata.
However it has one issue: It could not update metadata for lookup column but it does not throw any error also.

Description

This article will show you how to upload metadata and how to update lookup column while uploading document.
public int UploadFile(string destinationPath, string destinationFolderPath, string sourceFilePath)
{
    /*
    // Example of parameters for this function
 
    //Parameter 1
    string destinationPath = <SiteUrl> + "/" + <DocumentLibraryName> + "/" + <FolderName1> 
                               + "/" + <FolderName2> + "/" + <FileName>;
    //Example
    string destinationPath = "http://sharepoint.infoyen.com" + "/" + "HistoricalDocs" 
                                + "/" + "Historical" + "/" + "IT" + "/" + "Historical_IT.doc";
 
    //Parameter 2
    string destinationFolderPath = <SiteUrl> + "/" + <DocumentLibraryName> + "/" + <FolderName1> 
                                     + "/" + <FolderName2>;
    //Example
    string destinationFolderPath = "http://sharepoint.infoyen.com" + "/" + "HistoricalDocs"  
                                     + "/" + "Historical" + "/" + "IT";
 
    //Parameter 3
    string sourceFilePath = "c:\HistoricalDocs\Historical\20121111\IT\Historical_IT.doc;
    */
 
 int result = -1; // -1 means failure
 Copy.Copy copyReference = new Copy.Copy();
 try
 {
  string destination = destinationPath;
  string[] destinationUrl = { destination };
  byte[] fileBytes = GetFileFromFileSystem(sourceFilePath);
  copyReference.Url = settings.SiteUri.ToString().TrimEnd('/') + "/_vti_bin/copy.asmx";
  copyReference.Credentials = new NetworkCredential(settings.User, settings.Password, settings.Domain); ;
 
  Copy.CopyResult[] cResultArray = null;
  Copy.FieldInformation documentTypeField = new Copy.FieldInformation();
  documentTypeField.DisplayName = "DocumentType";
  documentTypeField.Type = Copy.FieldType.Text;
  documentTypeField.Value = "HR";
  Copy.FieldInformation titleField = new Copy.FieldInformation();
  titleField.DisplayName = "Title";
  titleField.Type = Copy.FieldType.Text;
  titleField.Value = "HR1";
 
  //Associate metadata
  Copy.FieldInformation[] filedInfo = { documentTypeField, titleField };
  //Upload the document from Local to SharePoint
  copyReference.CopyIntoItems(destination, destinationUrl, filedInfo, fileBytes, out cResultArray);
  //Get item id of uploaded docuemnt // fileName will be like abc.pdf
  string fileName = Path.GetFileName(destinationPath);
  string queryXml = "<Where><And><Eq><FieldRef Name=’FileLeafRef’ /><Value Type=’File’>" + fileName +
   "</Value></Eq><Eq><FieldRef Name=’ContentType’ /><Value Type=’Text’>Document</Value></Eq></And></Where>";
  string itemId = GetItemID(settings.DocumentLibrary, queryXml, destinationFolderPath);
 
  result = Convert.ToInt32(itemId);
 }
 catch (Exception ex)
 {//exception code here 
 }
 finally
 {
  if (copyReference != null)
   copyReference.Dispose();
 }
 return result;
}
private byte[] GetFileFromFileSystem(string path)
{
 byte[] fileBytes = null;
 
 if (File.Exists(path))
 {
  //read the file.
  using (FileStream fs = File.Open(path, FileMode.Open))
  {
   fileBytes = new byte[fs.Length];
   fs.Position = 0;
   fs.Read(fileBytes, 0, Convert.ToInt32(fs.Length));
  }
 }
 return fileBytes;
}
public string GetItemID(string strListName, string queryXml, string destinationFolderPath)
{
 Lists.Lists listReference = new Lists.Lists();
 string lookupId = string.Empty;
 try
 {
  listReference.Credentials = credentials;
  listReference.Url = settings.SiteUri.ToString().TrimEnd('/') + "/_vti_bin/lists.asmx";
  System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
  System.Xml.XmlElement query = xmlDoc.CreateElement("Query");
  System.Xml.XmlElement viewFields = xmlDoc.CreateElement("ViewFields");
  System.Xml.XmlElement queryOptions = xmlDoc.CreateElement("QueryOptions");
  query.InnerXml = queryXml;
  viewFields.InnerXml = "<FieldRef Name="ID" />";
  queryOptions.InnerXml = "<Folder>" + destinationFolderPath + "</Folder>";
  System.Xml.XmlNode items;
  if (String.IsNullOrEmpty(destinationFolderPath))
   items = listReference.GetListItems(strListName, string.Empty, query, viewFields, string.Empty, null, null);
  else
   items = listReference.GetListItems(strListName, string.Empty, query, viewFields, string.Empty, 
                                                           queryOptions, null);
 
  foreach (System.Xml.XmlNode node in items)
  {
   if (node.Name == "rs:data")
   {
    for (int i = 0; i < node.ChildNodes.Count; i++)
    {
     if (node.ChildNodes[i].Name == "z:row")
     {
      lookupId = node.ChildNodes[i].Attributes["ows_ID"].Value;
      break;
     }
    }
   }
  }
 }
 catch (Exception ex)
 {
  //exception
 }
 finally
 {
  if (listReference != null)
   listReference.Dispose();
 }
 
 return lookupId;
}
Function UpdateMetaData:
public void UpdateMetaData(string strListName, string strCAML)
{
 Lists.Lists listReference = new Lists.Lists();
 try
 {
  listReference.Credentials = credentials;
  listReference.Url = settings.SiteUri.ToString().TrimEnd('/') + "/_vti_bin/lists.asmx";
 
  /*Get Name attribute values (GUIDs) for list and view. */
  System.Xml.XmlNode ndListView = listReference.GetListAndView(strListName, "");
  string strListID = ndListView.ChildNodes[0].Attributes["Name"].Value;
  string strViewID = ndListView.ChildNodes[1].Attributes["Name"].Value;
 
  /*Create an XmlDocument object and construct a Batch element and its
   attributes. Note that an empty ViewName parameter causes the method to use the default view. */
  System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
  System.Xml.XmlElement batchElement = doc.CreateElement("Batch");
  batchElement.SetAttribute("OnError", "Continue");
  batchElement.SetAttribute("ListVersion", "1");
  batchElement.SetAttribute("ViewName", strViewID);
 
  /*Specify methods for the batch post using CAML. To update or delete, 
   specify the ID of the item, and to update or add, specify 
   the value to place in the specified column.*/
  batchElement.InnerXml = strCAML;
 
  /*Update list items. This example uses the list GUID, which is recommended, 
   but the list display name will also work.*/
  listReference.UpdateListItems(strListID, batchElement);
 }
 catch (Exception ex)
 {
  //exception
 }
 finally
 {
  if (listReference != null)
   listReference.Dispose();
 }
}

Copying SharePoint Designer 2010 Workflows

Whenever you save a list as a template & use it somewhere else, the designer workflow you have associated with the old list will not be restored. There is no option OOB to copy/move a workflow. But luckily this can be done through the SharePoint Designer. Here below two files play a major role,
The .xoml.wfconfig.xml file contains information on the list the workflow is bound to using the List’s ID.
The file .xoml.rules contains the ‘conditions’ you program for the workflow and the “.xoml” file contains the ‘actions’.
To re-use a workflow you have created in one list(Say List A) in another list(Say List B):
  1. Create a new workflow on the new list(B).
  2. Create at least one step, one condition and one action in this workflow. This ensures that the two files above discussed are created.
  3. From the original workflow(in List A) open the .xoml file as XML and copy the entire contents to the clipboard.
  4. Open the .xoml file for the new workflow and replace the entire contents with the content you have copied in the step 3.
  5. Do the same for the xoml.rules file too.
  6. Now open the .xoml file for the new workflow & verify the workflow. Ensure the workflow is correct by clicking Check Workflow.
Most often, we required moving or copying a workflow that is created using SharePoint designer between sites or site collections.
There was an option in SharePoint Designer, Export to Visio which exports your workflow as a .vwi file, and can be imported in to another site using the option Import from Visio. But when you try that option, you will get the below message.
This workflow cannot be imported because it was created in SharePoint Designer for a different site, or the original workflow has been moved or deleted. To move a workflow between sites, use Save as Template (.wsp file) instead of a Visio workflow drawing.
So, to achieve the same follow the steps below.
  1. In the first(source) site, create the required workflow and publish it.
  2. Now select Export to Visio option which allows you to save the workflow with a .vwi extension. (Refer this workflow hereafter as source workflow).
  3. Now go to the destination site where you want the workflow to be copied, and create a new workflow with the same name as the previous one & publish it.
  4. Now select Export to Visio option which allows you to save the workflow with a .vwi extension. (Refer this workflow hereafter as Destination workflow).
  5. Now you will be having two .vwi files (one of source workflow’s – SourceWorkflowName.vwi and other of the destination workflow’s – DestinationWorkflowName.vwi). Now add .zip extension to both the files. Now your files names should be SourceWorkflowName.vwi.zip&DestinationWorkflowName.vwi.zip.
  6. Now open both the zip files, copy workflow.xoml.wfconfig.xml from destination workflow to source workflow. (Its destination to source and not source to destination).
  7. From now on, we will not use the file DestinationWorkflowName.vwi.zip. So ignore that file.
  8. Remove the .zip extension from SourceWorkflowName.vwi.zip which gives you theSourceWorkflowName.vwi file.
  9. Now, go to the destination site, open workflows and click Import from Visio and browse to theSourceWorkflowName.vwi file.
  10. That’s it and your workflow is copied. You can publish the workflow and run it.
PS : In case if your list’s GUID’s (for those lists that you have used in workflow – tasks list, history list or any other lists used in workflow steps) have been changed from source & destination site, you may need to update those steps in the workflow.
Hope this helps.
HarePoint Workflow Migration for SharePoint
​​​HarePoint Workflow Migration for SharePoint – this is an ideal tool for simple, quick, and error-free migration of the most complex workflows from one SharePoint environment to another.
https://www.harepoint.com/Products/HarePointWorkflowMigration/Default.aspx
How to move or copy a SharePoint Designer 2010 List Workflow to another list on the same site or another site.
http://blog.karstein-consulting.com/2011/02/10/walkthrough-how-to-move-or-copy-a-sharepoint-designer-2010-list-workflow-to-another-list-on-the-same-site-or-another-site/
How to copy SharePoint list workflow
We often face a situation where we need to copy a big workflow from list or library to another list or library. This situation can be avoided if we have created the workflow as reusable workflow.
So in this article I will explain in simple steps on how to copy a list workflow to another workflow using SharePoint designer. Using this method we can copy workflow across site collections are web applications.
For this we have the following
List Name
Workflow Name
List 1
List Workflow 1
List 2
List Workflow 2 (Copied from the worlflow1)
Step 1)
We have the list 1 with list workflow 1 to be copied to list workflow 2.
Step 2)
Now create a list workflow 2 , in list 2 with one condition plus once activity and save it.
In our example I have used a condition and sending email to current user. This is used to create the Xoml rules for the list workflow 2
Step 3)
Now in the side of navigation click All Files
Step 4)
In all files click the Workflows
Step 5)
Open the List workflow 1 and also repeat the steps 3,4 and open List workflow 2 in another tab
Step 6)
List workflow 1 and list workflow 2 are will be displaying like this when you have done the steps 3,4,5 correctly.
Step 7)
Copy the .xoml and xoml.rules to the targeted workflow.
In our example List workflow 1.xoml and list workflow 1.xoml.rules are copied from list workflow 1 folder to list workflow 2 folder
Step 8)
Rename the files from List workflow 1.xoml to List workflow 2.xoml
And list workflow 1.xoml.rules to list workflow 2.xoml.rules
While renaming a working message will be displayed click Yes.
Step 9)
Now close and reopen the SharePoint designer.
After opening the List workflow 2 we can notice the workflow has been copied from list workflow 1.
Source : http://soussi-imed.over-blog.com/2015/03/copying-sharepoint-designer-2010-workflows.html

SharePoint and Web Services

Windows SharePoint Services was being designed and developed during the time when Microsoft was beginning to heavily push Web services. It should be no surprise, then, to find out that you can get at the data in SharePoint through Web services. In fact, there's not just one Web service involved; there are 16. Here's a brief rundown of the Web services that a SharePoint server makes available out of the box:

  • http://server:1111/_vti_adm/Admin.asmx - Administrative methods such as creating and deleting sites
  • http://server/_vti_bin/Alerts.asmx - Methods for working with alerts
  • http://server/_vti_bin/DspSts.asmx - Methods for retrieving schemas and data
  • http://server/_vti_bin/DWS.asmx - Methods for working with Document Workspaces
  • http://server/_vti_bin/Forms.asmx - Methods for working with user interface forms
  • http://server/_vti_bin/Imaging.asmx - Methods for working with picture libraries
  • http://server/_vti_bin/Lists.asmx - Methods for working with lists
  • http://server/_vti_bin/Meetings.asmx - Methods for working with Meeting Workspaces
  • http://server/_vti_bin/Permissions.asmx - Methods for working with SharePoint Services security
  • http://server/_vti_bin/SiteData.asmx - Methods used by Windows SharePoint Portal Server
  • http://server/_vti_bin/Sites.asmx - Contains a single method to retrieve site templates
  • http://server/_vti_bin/UserGroup.asmx - Methods for working with users and groups
  • http://server/_vti_bin/versions.asmx - Methods for working with file versions
  • http://server/_vti_bin/Views.asmx - Methods for working with views of lists
  • http://server/_vti_bin/WebPartPages.asmx - Methods for working with Web Parts
  • http://server/_vti_bin/Webs.asmx - Methods for working with sites and subsites

To use any of these Web services, replace server with the name of your SharePoint server. Because they're implemented using ASP.NET code, you can retrieve the matching WSDL file for any service by appending ? WSDL to the end of the URL.

SharePoint 2013: Service Accounts

For a SharePoint installation, this page recommends the following best practices and naming conventions for service accounts. In your deployment you many not need all these accounts. For example, if PerformancePoint will not be deployed then you will not need the PerformancePoint service account.
The account name is arbitrary. But, ensure the length of the account is within the character limits (see below: SharePoint and Managed Service Accounts and SharePoint Service Account Character Length) and the name is short while at the same time descriptive enough.
Service Accounts
SQL Server
SQL Admin
SQL Service
SharePoint Server
SP Admin
SP Farm
SP Web Application
SP Services
SP C2WTS
SP Cache Super User
SP Cache Super Reader
SP Excel User
SP Visio User
SP PerformancePoint User
SP My Site Application Pool Account
SP Profile Synchronization
SP Search Service
SP Search Crawl
Project Server
Accounts
Groups
SharePoint and Managed Service Accounts
SharePoint Service Account Character Length
  • SQL Server Accounts
    • SQL Admin
    • SQL Service
  • SharePoint Server Accounts
    • SP Admin
    • SP Farm
    • SP Web Application
    • SP Services
    • SP C2WTS
    • SP Cache Super User
    • SP Cache Super Reader
    • SP Excel User
    • SP Visio User
    • SP PerformancePoint User
    • SP Profile
    • SP Profile Sync
    • SP Search Crawl
  • Project Server Accounts and Groups
    • PS Project
    • PS Workflow Proxy
    • PS Project Report
    • PS Project Report Authors
    • PS Project Report Viewers
    • PS Project External Report Viewers
  • Setup User Administrator Account
  • Used for:
    • SQL Server Administrator (this account has unrestricted access to the DB engine)
    • SQL installation/update/upgrade
  • Domain account
  • Local Admin on SQL Server machine
  • Used for:
    • Running SQL Server engine and SQL Server Agent.
  • Domain account
  • Preferably Managed Service Account
  • Optionally, for more secure environments you will want to create multiple account (all domain accounts and MSA) for each of SQL Server services.
    • SQL Service - for SQL DB Engine
    • SQL Agent Service - for SQL Agent
    • SQL AS Service - for SQL Server Analysis Services
    • SQL RS Service - for SQL Server Reporting Services
    • SQL IS Service - for SQL Server Integration Services
    • SQL DR Controller Service - for Distributed Replay Controller
    • SQL DR Client Service - for Distributed Replay Client
  • Setup User Administrator Account
  • Used for:
    • SharePoint installation
    • Running the SharePoint Product Configuration Wizard
    • Other Farm configurations
  • Domain account
  • Local Admin on APP and WFE servers
  • SharePoint Database Access Account (AKA SharePoint Farm Service Account)
  • Used for:
    • Central Administration app pool identity
    • Microsoft SPF Workflow Timer Service account
  • Domain account
  • During User Profile Synchronization application provisioning needs to be local admin and have Log On Locally rights on the Server that will be hosting the UPS application
    • After UPS application provisioning remove the local admin privilege but keep the Log On Locally rights
    • After giving this account local admin and Log On Locally rights permissions, it is important that you logout and log back into the server (or restart the server)
  • Web Application Pool Account
  • Used for:
    • Application pool identity for the main web application IIS website
  • Domain account
  • SharePoint Web Services Application Pool Account
  • Used for:
    • Application pool identity for the SharePoint Web Services IIS website
  • Domain account
  • Claims to Windows Token Service Account
  • Used as the identity for the Claims to Windows Token Service account
  • Create this dedicate account if you plan to use Excel, Visio, PerformancePoint, or Office Web Apps Excel services.
  • Domain account
  • Local Admin on SharePoint Servers that will be running any of the following services:
    • Excel Services
    • Visio Service
    • PerformancePoint Service
    • Office Web Apps Excel Service
  • Portal Super User
  • Used for:
    • Super user cache account
  • Domain account
  • This account requires Full Control access to the web application.
  • Portal Super Reader
  • Used for:
    • Super reader cache account
  • Domain account
  • This account requires Full Read access to the web application.
  • Excel Service Unattended Service Account
  • Used for:
    • Connecting to external data sources that require a username and password that are based on OS other than Windows for authentication
  • Domain account
  • Visio Graphics Service Unattended Service Account
  • Used for:
    • Connecting to external data sources that require a username and password that are based on OS other than Windows for authentication
  • Domain account
  • PerformancePoint Service Unattended Service Account
  • Used for:
    • Connecting to external data sources that require a username and password that are based on OS other than Windows for authentication
  • Domain account
  • My Sites Application Pool Account
  • Used for:
    • My Site application pool
  • Domain account
  • If you are hosting My Site site collection under the same web application as other site collections, then you don't need this account. Create this account only if you are creating a dedicated web application of My Site site collection, in which case you set the web application app pool account to this account.
  • Synchronization Account
  • Used for:
    • Connecting to a directory service
    • User Profile Services to access AD
    • User Profile Services to run profile synchronization
  • Domain account
  • This accounts requires Replicate Directory Changes in AD DS on the domain node
    • The Grant Replicate Directory Changes permission does not enable an account to create, change or delete AD DS object. It enables the account to read AD DS objects and to discover AD DS object that were changed in the domain.
  • Search Service Account
  • Used for:
    • Windows user credentials for the SharePoint Search service
  • Domain account
  • Default Content Access Account
  • Used for:
    • For Search service application to crawl content.
  • Domain account
  • This account must have read access to external or secure content sources that SharePoint will be crawling.
  • For SharePoint sites that are not part of the server farm, this account must explicitly be granted full read permissions to the web applications that host the sites
If planning to deploy Project Server the following accounts and groups are required for least-privilege scenario
  • PS Project
    • Project Server Service Application Application Pool Account
    • Database owner for content databases with the Web application
    • Read/write access to the associated Project Server Service Application database
    • Read permission on SharePoint_Config database
  • PS Project Report
    • Secure Store Target Application Account
    • This account provides the credentials needed for report viewers to view reports generated from data in the PWA database.
    • This account is used as part of the Secure Store Configuration
    • Add this account to the Report Authors Active Directory group
    • Permission:
      • Database datareader on PWA database
  • PS Workflow Proxy
    • Project Server Workflow Activities Account
    • This account is used to make Project Server Interface (PSI) calls associated with each workflow.
    • Configured as a Project Server user account, with the following permissions:
      • Global permissions:
        • Log On
        • Manage Users and Groups
        • Manage Workflow and Project Detail Pages
      • Category permissions:
        • Open Project
        • Save Project to Project Server
    • If using SharePoint Permission mode, add this account to the Administrators for PWA security group
  • PS Project Report Authors
    • Report Authors Group
    • AD security group - Global
    • Users in this group can create reports
    • If report authors will also be viewing reports, add this group to the Report Viewer Group
    • Permission: db_datareader on PWA database
  • PS Project Report Viewers
    • Report Viewers Group
    • AD security group - Global
    • Users in this group can view reports
    • This group is used as part of Secure Store configuration
      • That is, add the Secure Store account to this group
  • PS Project External Report Viewers
    • External Report Viewer Group
    • This account is optional
    • Users that do not have a PWA user account but require access to the Project Server BI Center to view reports
    • Add the Secure Store Target Application Account to the Report Authors Active Directory group
    • Permissions:
      • Read permission to the BI Center site
For SharePoint service accounts, do not create Active Directory Domain Services accounts that are Managed Service account or Virtual Service account. These two type of service accounts were introduced in Windows Server 2008 R2 and Windows 7. They are not supported in SharePoint 2013.

For SQL Server services use Managed Service account, if using SQL Server 2012. Managed Service account is now supported in SQL Server 2012. For example, you can use MSA for the SQL Server Engine and SQL Server Agent. Use MSA for SQL Server accounts that will not be used to login to the server. You can't use MSA to login to a server. The use of MSA for SQL Server services is considered as best practice. MSAs are limited to a total of 15 characters (this does not include the DOMAIN\ part). The following provides a good reference on how to enable MSA (http://blogs.technet.com/b/rhartskeerl/archive/2011/08/22/sql-server-code-name-denali-adds-support-for-managed-service-accounts.aspx )
SharePoint service accounts (managed accounts) are limited to a total of 20 characters - including the Domain Name (for example Domain\SP_Name - total characters should be less than 20). This limitation is not imposed on SQL Server service accounts or SharePoint's Setup User Account (ex: SPAdmin). But to be on the safe side, I would still follow the 20 to 25 character limit.
Source : http://soussi-imed.over-blog.com/2015/04/sharepoint-2013-service-accounts.html

 

Copyright @ 2015 SOLUTION FOR ALL.

Designed by BENZAEID RAMZI