Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

2

Nope, you can't create a content database through CSOM.


0

How about just adding Departement as a metadata field on the library? If needed you can inject that value into the doc as a quick part. Enforcing a naming conversion is a huge can of worms, so user training and monitoring often is better way than a technical solution


0

You can use SharePoint Designer Workflow or Microsoft Flow to update filenames on creation, but it’s not much of an enforcement. Please see the post below. How to give naming convention for a document library.


0

Here is what I ended up getting to work... eq is a record number I needed to use to create the subfolder or look in that subfolder. /// <summary> /// This procedure uploads documents to the Authorizations Library /// </summary> /// <param name="filename">File Being Uploaded</param> /// <param name="p"...


0

Here is how I did my pooling to check if the site is complete : var tenant = new Tenant(ctx); var siteCreationProperties = new SiteCreationProperties(); // Create the site collection var spo = tenant.CreateSite(siteCreationProperties); // We will need the IsComplete property to check if the provisioning of the Site Collection is complete. ctx.Load(spo, i ...


2

If you're developing a custom command set for a list, after installing the SPFx package to the app catalog, you need to attach your command set to the target list with the code: var list = clientContext.Web.Lists.GetById(listId); var customActions = list.UserCustomActions; var customAction = customActions.Add(); customAction.ClientSideComponentId = new ...


0

I've tested your code. It works correctly. Make sure nonvalid-user really doesn't have any permissions. On https://mysite.com/_layouts/15/user.aspx page press Check Permissions button. Type nonvalid-user in the popup and press Check Now. It should show only Limited Access.


0

Found a solution: var sourceSite = "https://xxx.sharepoint.com/sites/afd-xxx-oprydning-test-source"; var targetSIte = "https://xxx.sharepoint.com/sites/afd-xxx-oprydning-test-target"; var ctxSource = ClientContextExtension.GetAppContext(sourceSite, _config.AppRegistrationId, _config.AppRegistrationKey, "SaveToExcel", new EmptyLogger()); var ctxTarget = ...


2

You can not move file using file.MoveTo method from one site to another site. There is no built-in method in SharePoint CSOM for moving Files from one site into another. But you can use below procedure to move file. public static void FileMove(string srcUrl, string destUrl, string srcLibrary, string destLibrary, string srcFileName) { ClientContext ...


0

You can get the file using a caml query. private void UpdateMetaData(string urlfilepath, string library, Dictionary<string, string> mydictionary) { using (var context = new ClientContext(qsURLSite)) { context.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; var web = ...


0

Based on our discussion, I was having the same problem but the problem was slightly different. Why this is happening: When you a add new user to AD, the profile sync job takes some time to pick the newly added user and create the SP UPS entry, and which finally syncs with all site collections and creates entry in UIL. Until the UPS is not available, people ...


0

I had to replace CAML Query. Now I am able to get All fieldValues. Following code change for reference: $camlQuery = New-Object Microsoft.SharePoint.Client.CamlQuery $camlQuery.ViewXml ="<View Scope='RecursiveAll' />"; $listItems=$list.GetItems($camlQuery) $ctx.Load($listItems); $ctx.ExecuteQuery();


0

Try following code: foreach($listItem in $listItems) { if($listItem.FileSystemObjectType -eq "File") { $file = $listItem.File $fileProps = $file.ListItemAllFields $context.Load($file) $context.Load($fileProps) $context.ExecuteQuery() ...


0

This was a bit longer and more complicated than anticipated but I have managed it just using flow. This answer assumed your _v1, _v2 documents are being added to a SharePoint document library, if they are not, you will need to add a couple steps to the start of this flow to move them into a library to kick off the rest of the flow. The initial trigger is ...


0

If your target is a "modern" communication site, you can use the Classification property of CSOM to update the value. If your target is a "modern" team site and you want to update the classification value, you should use the Microsoft Graph. More information: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/modern-experience-site-...


0

SharePoint server is trying to establish named pipes connection to Claims to Windows Token Service using account which doesn't have necessary permissions. This is a false positive and most likely doesn't have to do anything with your original error. Since CSOM doesn't allow you to run the code with elevated privileges, this error can't avoided by using CSOM ...


-1

Are you familiar with version history in the Document Library settings? If version history is activated, the external users can save their revised version of the file with exactly the same file name - this would become a new version of the same file. Consequent changes to the file would result in the version history being built up e.g. Version 0.1 (user ...


Top 50 recent answers are included