Last day I ran into an issue (maybe I'll post that later) when I had to rename multiple files in a Document Library that resides on an Office 365 SharePoint instance.
What I did was the following:
Cannot set unknown member 'CompositeTask.PreserveIncompleteTasks'. HTTP headers received from the server Microsoft.Workflow.Client.ActivityValidationException: Workflow XAML failed validation due to the following errors: Cannot set unknown member 'CompositeTask.PreserveIncompleteTasks'. HTTP headers received from the server - ActivityId: 51341428-f7a1-4856-8303-fcbc699335ea. NodeId: SPSRV. Scope: /SharePoint/default/8f0c9dfe-6f01-499c-a356-a417da9b39b4/53d5e7f1-0360-4909-8997-71eaf26b140d. Client ActivityId : a1627f9c-bdfc-80a3-b6fd-cf246a4e8993. ---> System.Net.WebException: The remote server ret
Register-SPWorkflowService -SPSite https://portal.mydomain.net -WorkflowHostUri https://spsrv:12290 -Force
if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin Microsoft.SharePoint.PowerShell
}
$site = get-spsite -identity "http://myspportal"
foreach($web in $site.AllWebs)
{
if ($web.Url.Contains("http://myspportal/HR/")) # Look for only under HR
{
$Lists = $web.Lists | Where-Object {$_.Title -Like "*Reports*"} # Pattern to look for in LISTS names
$roleReadOnly = $web.RoleDefinitions["Read"]
foreach($list in $lists)
{
foreach($item in $list.Items | Where-Object {$_.Name -like "*budget*.xls*"}) # Filename pattern is *budget*.xls*
{
Write-Host $item.ParentList.ParentWeb.Url+'/'+$item.URL + ' ' + $item.Name
if ($item.HasUniqueRoleAssignments -eq $false)
{
$item.BreakRoleInheritance($true);
}
foreach ($ra in $item.RoleAssignments | Where-Object {$_.RoleDefinitionBindings.Name -eq "Contribute" -or $_.RoleDefinitionBindings.Name -eq "Full Control" -or $_.RoleDefinitionBindings.Name -eq "Edit"})
{
$ra.RoleDefinitionBindings.RemoveAll()
$ra.RoleDefinitionBindings.Add($roleReadOnly)
$ra.Update()
}
}
}
}
}
if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin Microsoft.SharePoint.PowerShell
}
$site = Get-SPSite -Identity "http://spdev/sites/SiteCollection"
foreach($web in $site.AllWebs)
{
if ($web.HasUniquePerm -and $web.RequestAccessEnabled -and ($web.Url.Contains("/SiteCollection/BU1") -or $web.Url.Contains("/SiteCollection/BU2")))
{
$account = $web.EnsureUser("Domain\QATeam")
$role = $web.RoleDefinitions["Contribute"]
$assignment = New-Object Microsoft.SharePoint.SPRoleAssignment($account)
$assignment.RoleDefinitionBindings.Add($role)
$web.RoleAssignments.Add($assignment)
}
$web.Dispose()
}
$site.Dispose()
#updated on 10/17/2013
# URL of the Site
$web = Get-SPWeb -Identity "https://sharepointsrv/site1"
$manager = $web.Site.WorkFlowManager
# Name of the list
$list = $web.Lists["Shared Documents"]
# Name of the Workflow
$assoc = $list.WorkflowAssociations.GetAssociationByName("On Item Created","en-US")
$data = $assoc.AssociationData
$items = $list.Items
foreach($item in $items)
{
$wf = $manager.StartWorkFlow($item,$assoc,$data,$true)
}
$manager.Dispose()
$web.Dispose()
#
20635 08/22/2013 15:56:05.84 w3wp.exe (0x15D0) 0x2EDC SharePoint Foundation Logging Correlation Data xmnv Medium Name=Request (GET:https://spdevsrv:443/sites/dev1/WeeklyStatus/undefined?InstanceID=20130710&Paged=Next&p_StartTimeUTC=20130703T120000Z&View=%7bFEF87B6F%2d54D6%2d44CD%2d8055%2dFA404C0A5B50%7d) 57843b9c-4d5d-80a3-b6fd-c40b260782c1 20636 08/22/2013 15:56:05.84 w3wp.exe (0x15D0) 0x2EDC SharePoint Foundation Authentication Authorization agb9s Medium Non-OAuth request. IsAuthenticated=True, UserIdentityName=0#.w|domain\user, ClaimsCount=43 57843b9c-4d5d-80a3-b6fd-c40b260782c1 20637 08/22/2013 15:56:05.85 w3wp.exe (0x15D0) 0x58E8 SharePoint Foundation General af71 Medium HTTP Request method: GET 57843b9c-4d5d-80a3-b6fd-c40b260782c1 20638 08/22/2013 15:56:05.85 w3wp.exe (0x15D0) 0x58E8 SharePoint Foundation General af75 Medium Overridden HTTP request method: GET 57843b9c-4d5d-80a3-b6fd-c40b260782c1 20639 08/22/2013 15:56:05.85 w3wp.exe (0x15D0) 0x58E8 SharePoint Foundation General af74 Medium HTTP request URL: /sites/dev1/WeeklyStatus/undefined?InstanceID=20130710&Paged=Next&p_StartTimeUTC=20130703T120000Z&View=%7bFEF87B6F%2d54D6%2d44CD%2d8055%2dFA404C0A5B50%7d 57843b9c-4d5d-80a3-b6fd-c40b260782c1 20640 08/22/2013 15:56:05.85 w3wp.exe (0x15D0) 0x58E8 SharePoint Foundation Files aise3 Medium Failure when fetching document. 0x80070002 57843b9c-4d5d-80a3-b6fd-c40b260782c1 20641 08/22/2013 15:56:05.87 w3wp.exe (0x15D0) 0x5198 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Request (GET:https://spdevsrv:443/sites/dev1/WeeklyStatus/undefined?InstanceID=20130710&Paged=Next&p_StartTimeUTC=20130703T120000Z&View=%7bFEF87B6F%2d54D6%2d44CD%2d8055%2dFA404C0A5B50%7d)). Execution Time=37.2469 57843b9c-4d5d-80a3-b6fd-c40b260782c1
$web = Get-SPWeb -Identity "https://spdevsrv:443/sites/dev1" $web.MasterUrl = "/sites/dev1/_catalogs/masterpage/mwsdefaultv15.master" $web.CustomMasterUrl = "/sites/dev1/_catalogs/masterpage/mwsdefaultv15.master" $web.Update() $web.Dispose()
$site = Get-SPSite -Identity "https://spdevsrv:443/sites/dev1"
$webs = $site.AllWebs
$CorrectMasterPage = "/_catalogs/masterpage/mwsdefaultv15.master"
foreach($web in $webs)
{
if (($web.WebTemplate -eq "MPS") -and ($web.WebTemplateId -eq 2))
{
write-host "Updating" $web.Url
$MasterPageURL = $web.ServerRelativeUrl + $CorrectMasterPage
$web.MasterUrl = $MasterPageURL
$web.CustomMasterUrl = $MasterPageURL
$web.Update()
}
$web.Dispose()
}
$web = Get-SPWeb -Identity "http://spsrv/sites/web1/" Write-Host $web.WebTemplate "," $web.WebTemplateId
Get-SPWebTemplate | select ID, Name, Title | Sort-Object ID
$ver = $host | select version
if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = "ReuseThread"}
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$web = Get-SPWeb -Identity "http://portal/sites/Requests"
$lists=$web.Lists["User Request", "Hardware Request", "Employee Request"]
$SourceView="All Items"
$NewViewName="Created By Me"
$NewViewDefault=$true
foreach($list in $lists) {
$view = $list.Views[$SourceView]
$Viewfields = $list.Views[$SourceView].ViewFields.ToStringCollection()
$viewRowLimit="100"
$viewPaged=$true
$viewDefaultView=$NewViewDefault
# Setting the Query for the View
$viewQuery = " "
$viewName = $NewViewName
# Finally – Provisioning the View
$myListView = $list.Views.Add($viewName, $viewFields, $viewQuery, 100, $True, $False, "HTML", $False)
# You need to Update the View for changes made to the view
# Updating the List is not enough
$myListView.DefaultView = $True
$myListView.Update()
$list.Update()
}
$web.Dispose()
SharePoint Server 2010 Enterprise.
Checking the SharePoint Logs, found the following errors repeating each minute:
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Timer Job job-diagnostics-io-intensive-query-provider)
OWSTIMER.EXE (0x17A8) 0x3264 Extended Diagnostic Providers SqlTrace Provider 2001 Unexpected Failed to get legacy traces
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Timer 6398 Critical The Execute method of job definition Microsoft.SharePoint.Diagnostics.SPIOIntensiveQueryDiagnosticProvider (ID c2f9c9c0-5d41-43a4-98bf-c59b007c3065) threw an exception. More information is included below. You do not have permission to run 'SP_TRACE_CREATE'.
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Timer 72ae Unexpected Exception stack trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Bo...
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Timer 72ae Unexpected ...olean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.SharePoint.Diagnostics.SqlTraceHelper.CreateTrace() at Microsoft.SharePoint.Diagnostics.SqlTraceStreamer.Init(SqlTraceParameters parameters) at Microsoft.SharePoint.Diagnostics.SPSqlTraceDiagnosticProvider.InitializeBackgroundThreads() at Microsoft.SharePoint.Diagnostics.SPSqlTraceDiagnosticProvider.Sync() at Microsoft.SharePoint.Diagnostics.SPDiagnosticsProvider.Execute(Guid targetInstanceId) at Microsoft.SharePoint.Administration.SPTimerJobInvokeInternal.Invoke(SPJobDefinition jd, Guid targetInstanceId, Boolean isTi...
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Timer 72ae Unexpected ...merService, Int32& result)
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Timer Job job-diagnostics-io-intensive-query-provider). Execution Time=9.3616
Solution:
Grant the user running the SharePoint 2010 Timer (SPTimerV4) service, which is usually the Farm account, serveradmin or sysadmin rights on the SQL Server. Then, restart the Timer service.
Explanation:
blogs.msdn.com/b/kaevans/archive/2012/02/09/sharepoint-error-6398-you-do-not-have-permission-to-run-sp-trace-create.aspx - great article!
http://sptest/Subscriptions/_layouts/IniWrkflIP.aspx?TemplateID={fd570692-3e3e-4c6d-a613-d11932bfc5e2}&Source=http://sptest/Subscriptions/_layouts/IniWrkflIP.aspx?TemplateID={fd570692-3e3e-4c6d-a613-d11932bfc5e2}
SharePoint Server 2010.
I set up a Site Workflow that reads some properties of an employee from an external SQL Database.
> created a dbreader user in SQL Server
> added the SQL credentials to Secure Store
> created External Content Type in Designer
> created External List based on the previously created ECT
> user is able to see data in the External List
> created Workflow that reads data from the External List.
> running the Workflow will return empty data for any query from the External List
> following error in the logs
w3wp.exe (0x029C) 0x3D4C Secure Store Service Secure Store efr5 High ValidateCredentialClaims - Access Denied: Claims stored in the credentials did not match with the group claim for a group app.
w3wp.exe (0x029C) 0x3D4C Secure Store Service Secure Store 7493 Critical The Microsoft Secure Store Service application Secure Store Service failed to retrieve credentials. The error returned was 'Access is denied.'. For more information, see the Microsoft SharePoint Products and Technologies Software Development Kit (SDK).
w3wp.exe (0x029C) 0x3D4C Secure Store Service Secure Store efp6 Monitorable GetRestrictedCredentials failed with the following exception: System.ServiceModel.FaultException`1[Microsoft.Office.SecureStoreService.Server.SecureStoreServiceFault]: Access is denied. (Fault Detail is equal to Microsoft.Office.SecureStoreService.Server.SecureStoreServiceFault).  
w3wp.exe (0x43B8) 0x4320 SharePoint Foundation Workflow Infrastructure el2x Medium The workflow could not find the specified item in the external data source. Make sure the user has permissions to access the external data source and read items.
The System Account had no permission over the Secure Store Object to read the credentials to the SQL Server. The System Account is the account which is running the Application Pool .
Central Administration -> Manage Service Applications -> Secure Store Service : Manage -> Edit the application ID -> Next -> Next -> Add the AppPool user to the Members list.
A really nice, detailed guide on Business Connectivity Services can be found here.