SOLVED

Advanced Doc Library Settings with PowerShell - i.e. turn off "New Folder"

%3CLINGO-SUB%20id%3D%22lingo-sub-110161%22%20slang%3D%22en-US%22%3EAdvanced%20Doc%20Library%20Settings%20with%20PowerShell%20-%20i.e.%20turn%20off%20%22New%20Folder%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-110161%22%20slang%3D%22en-US%22%3E%3CP%3EI'd%20like%20to%20be%20able%20to%20programmatically%20modify%20some%20of%20the%20advanced%20settings%20on%20some%20document%20libraries%20using%20PnP%20Powershell.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESpecifically%2C%20I'd%20like%20to%20be%20able%20to%20set%20%22%3CSPAN%3EMake%20%22New%20Folder%22%20command%20available%3F%22%20to%20%22No%22%20and%20I'd%20like%20to%20change%20the%20value%20for%20%22Default%20open%20behavior%20for%20browser-enabled%20documents%3A%22%20to%20%22Open%20in%20the%20Client%20Application%22.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI've%20had%20a%20look%20around%20at%20various%20properties%2C%20but%20just%20can't%20seem%20to%20find%20it.%20%26nbsp%3BAny%20pointers%20greatly%20received.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EMany%20thanks%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ED.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-110161%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-110165%22%20slang%3D%22en-US%22%3ERe%3A%20Advanced%20Doc%20Library%20Settings%20with%20PowerShell%20-%20i.e.%20turn%20off%20%22New%20Folder%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-110165%22%20slang%3D%22en-US%22%3EManaged%20to%20turn%20off%20%22New%20Folder%22%20with%20the%20following%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%24ctx%20%3D%20Get-PnPContext%3CBR%20%2F%3E%24ndl%20%3D%20Get-PnPList%20-Identity%20%24Url%3CBR%20%2F%3E%24ctx.Load(%24ndl)%3CBR%20%2F%3E%24ctx.ExecuteQuery()%3CBR%20%2F%3E%24ndl.EnableFolderCreation%20%3D%20%24false%3CBR%20%2F%3E%24ndl.Update()%3CBR%20%2F%3E%24ctx.ExecuteQuery()%3C%2FLINGO-BODY%3E
Highlighted
Contributor

I'd like to be able to programmatically modify some of the advanced settings on some document libraries using PnP Powershell.

 

Specifically, I'd like to be able to set "Make "New Folder" command available?" to "No" and I'd like to change the value for "Default open behavior for browser-enabled documents:" to "Open in the Client Application".

 

I've had a look around at various properties, but just can't seem to find it.  Any pointers greatly received.

 

Many thanks,

D.

1 Reply
Highlighted
Solution
Managed to turn off "New Folder" with the following:

$ctx = Get-PnPContext
$ndl = Get-PnPList -Identity $Url
$ctx.Load($ndl)
$ctx.ExecuteQuery()
$ndl.EnableFolderCreation = $false
$ndl.Update()
$ctx.ExecuteQuery()