Powershell SharePoint 2016 csom 403 forbidden error

So new to CSOM and wanting to know if I am coding something wrong or where I need to look to resolve this issue. Or even if there is a SharePoint 2016 security setting that needs to be enabled for CSOM to work.

Also note, authentication is via Claims Authentication on the site it doesn’t work on.



Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\ISAPI\Microsoft.SharePoint.Client.Runtime.dll' Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\ISAPI\Microsoft.SharePoint.Client.dll' $  SharePointSite = 'https://Sharepointsite/sites/sitename' $  SharePointGroup = 'Test Group' $  Creds = Get-Credential $  SPContext = New-Object Microsoft.SharePoint.Client.ClientContext("$  SharePointSite")   $  SPContext.Credentials = $  Creds $  SPGroups=$  SPContext.Web.SiteGroups  $  SPContext.Load($  spGroups)          $  SPGroups=$  SPGroups.GetByName("$  SharePointGroup") $  SPContext.Load($  SPGroups)         $  SPContext.ExecuteQuery()  $  SPGroups.Title 

On my test side which is http://sharepointsite/site/testsite it works fine and finds the group.

On the root of the test site, https://sharepointsite/ it works and returns no group found.

On another site under the same root http://sharepointsite/sites/othersite it fails with “Access denied” but I don’t have access to that site.

When I test to an https://sharepointsite2 or https://sharepointsite2/site/testsite I get “403 Forbidden” But I have full access to sharepointsite2 root, sites, and central admin.

Migrate SharePoint Column Encryption / Decryption using RSA Machine-Level Crypto

I’m actively trying to find the best way to migrate machine-level encryption to a new server that will be running SharePoint 2019.

We use the RSACryptoService.cs to encrypt data being stored in a SharePoint column.


We haven’t made any changes to the web.config in relation to this. I’m also not able to find the key container using aspnet_regiis, so I’m assuming the crypto service creates it dynamically.

The only solution I can think that will work at the moment is to decrypt all of the data, move it to the new server, and then encrypt it on the new server.

Are there any other better options?

Can’t create Variation label for SharePoint site collection

Good day,

I have some problem with creating multi-language SharePoint site. I have site collection with “SharePoint Server Publishing Infrastructure enabled”. I follow this article here.

Following the article (Create the source variation site) I go to Site Collection Administration, click Variation labels. On the Variations Label page, I click New Label. I try to select Location field Value.

In the article was written “It they will be at the top level of the site collection, just type a forward slash (/)”

I type “/” in the Location field and get the error “The root site of the options should be the publication site”. I can’t understand, what is wrong if “SharePoint Server Publishing Infrastructure” option is enabled. “SharePoint Server Publishing” is enabled too.

Thank you in advance.

Get Microsoft Graph AccessToken from SharePoint ContextToken in RER

I have registered RemoteEventReceivers on my SharePoint list. I can receive remote events in my custom code. Is it possible to receive Microsoft Graph AccessToken from SharePoint ContextToken? I have to retrieve some data from Microsoft Graph in the context of the logged-in user. I know that I can use client id and client secret for it but I want to store correct value for Author and Editor field instead of System Account.

migration sharepoint 2010 to 2013

a try to migrate site collection from sharepoint 2010 to 2013, but i can’t see my site in the new URL, i have a default SP site

PS C:\Users\svc-bpm-sysadmin> Test-SPSite -Identity http://dv55udb01/ Test-SPSite : SPSiteHealthChecker: The element 'Rule' cannot contain child element 'RegexExclusionFilters' because the parent element's content model is empty.  SPSite="http://dv55udb01"  ruleId=00000000-0000-0000-0000-000000000000  repair=False  CompatibilityLevel=15  registrationFolderPath="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\CONFIG\SiteHealthCheck"  registrationFileName="sitehealthofficeserverrules.xml" At line:1 char:1 + Test-SPSite -Identity http://dv55udb01/ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidData: (Microsoft.Share...PCmdletTestSite:    SPCmdletTestSite) [Test-SPSite], SPSiteHealthCheckerException     + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletTestSite 

same error wen i try to Repair-SPSite

Thanks for help 🙂

Can excessive delays in workflows cause SharePoint timer job to be stuck?

One of my workflows has excessive delays and that too of a longer duration. For instance, one delay in my workflow is of three months and other is of a single month. Now the problem is that my SharePoint timer service gets stuck and its status is “Pausing”. Is it possible that the delays in workflows are causing the timer to be stuck? Has this happened to anyone before?

This article suggests that this problem can be caused by a bad workflow instance. Does my workflow come in that category?

Adding userGroup to subsite in sharepoint online using javascript

I want to add a user group to sharepoint subsite using javascript. I have used follwing code and it added a user group to subsite(ABS). and it also added user group to the parent site(OMSTest) which is a root sitecollection. why is that?

function CreateUserGroups(url)   {        var siteUrl = 'https://xxxx.sharepoint.com/sites/OMSTest/ABS';     var context = new SP.ClientContext(siteUrl);     var currentWEB = context.get_web();          var membersGRP = new SP.GroupCreationInformation();        var membershipArray = [];       var collContribute = SP.RoleDefinitionBindingCollection.newObject(context);      var rdContribute = currentWEB.get_roleDefinitions().getByName("Contribute");       collContribute.add(rdContribute);         membersGRP.set_title("GROUPP1");       membersGRP.set_description("GROUPP1");       var oMembersGRP = currentWEB.get_siteGroups().add(membersGRP);      oMembersGRP.set_allowMembersEditMembership(false);     oMembersGRP.set_onlyAllowMembersViewMembership(false);        var assignments = currentWEB.get_roleAssignments();     var roleAssignment = assignments.add(oMembersGRP, collContribute);        oMembersGRP.update();       membershipArray.push(oMembersGRP);               context.load(membershipArray[membershipArray.length - 1]);       //clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded2), Function.createDelegate(this, this.onQueryFailed2));      context.executeQueryAsync(           function () {                     alert("Group Created Successfully");           },           function (sender, args) {                           alert("Failed to create groups " + args.get_message());                       }); } 

how to duplicate pages in sharepoint

I am trying to copy page layout from one sub site to another, it contains web parts and also from the context menu this page layout contain duplicate options for creating multiple pages quickly (mavention.sharepoint.duplicate.min .js) i am using, but when i am copying to another site. the whole web parts are coming as well as js file also loading but duplicate options is not coming. please help.