Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4503
  • Last Modified:

PowerShell: Convert SDDL String to Binary Security Descriptor (Get-ACL to Set-ACL)

Hey guys,

I figure someone has probably done this somewhere already and I'm probably missing something simple.

I like the SDDL Output format from Get-ACL, and would like to use that format to import a Security Descriptor using Set-ACL. To do that I believe I need to convert the SDDL String back to a Security Descriptor.

There seems to be a WMI class to do exactly this, but it's only compatible with Vista and 2008, not entirely helpful at present.

Anyone know a quick way to handle that?

Thanks,

Chris
0
Chris Dent
Asked:
Chris Dent
1 Solution
 
BSonPoshCommented:
Get-ACL $folder
$folder.SetSecurityDescriptorSddlForm($sddl)
0
 
Chris DentPowerShell DeveloperAuthor Commented:

Far too easy :)

Thanks Brandon, that will do quite nicely.

Chris
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now