<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic multiple permissions for same trustee - how to realize with powershell in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/multiple-permissions-for-same-trustee-how-to-realize-with-powershell/m-p/144850#M5895</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i got a question from a customer which i'd like to discuss here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$tmpSDID  = "sd01"
$tmpPolID = "pol01"
&lt;BR /&gt;# AAAAA
# create new SD with temp-ID
$sd = New-NcFileDirectorySecurityNtfs     -SecurityDescriptor $tmpSDID&lt;BR /&gt;
# remove default entries from SD-DACL 
# defaults are for Creator/Owner ; nt auth/SYSTEM, builtin\administratros und bziltin\users all with full-control
Get-NcFileDirectorySecurityNtfsDacl -SecurityDescriptor $tmpSDID | Remove-NcFileDirectorySecurityNtfsDacl

# BBBBBB
# add permissions to DACL of the SD
$ace1 = Add-NcFileDirectorySecurityNtfsDacl -Account $g1 -SecurityDescriptor $tmpSDID -AccessType allow -Rights full_control -ApplyTo this_folder, sub_folders, files
$ace2 = Add-NcFileDirectorySecurityNtfsDacl -Account $g2 -SecurityDescriptor $tmpSDID -AccessType allow -Rights full_control -ApplyTo this_folder, sub_folders, files
$ace3 = Add-NcFileDirectorySecurityNtfsDacl -Account $g3 -SecurityDescriptor $tmpSDID -AccessType allow -Rights full_control -ApplyTo this_folder, sub_folders, files

# CCCCCCCCC
# create policy task
$poltsk = Add-NcFileDirectorySecurityPolicyTask -Name $tmpPolID -SecurityType ntfs -NtfsSecurityDescriptor $tmpSDID -Path $Path

# apply policy task
$r = Set-NcFileDirectorySecurity -Name $tmpPolID

# Cleanup of policy task and descriptors, wait 5 seconds to let the netapp digest...
Start-Sleep -Seconds 5
Remove-NcFileDirectorySecurityPolicy -Name $tmpPolID
Remove-NcFileDirectorySecurityNtfs   -Name $tmpSDID
&lt;/PRE&gt;
&lt;P&gt;Everything is fine till here. But the customer asks how to assign multiple permissions to the same trustee, which should work as follows:&lt;/P&gt;
&lt;PRE&gt; $ace1 = Add-NcFileDirectorySecurityNtfsDacl -Account $g1 -SecurityDescriptor $tmpSDID -AccessType allow -Rights read               -ApplyTo   this_folder&lt;BR /&gt; $ace2 = Add-NcFileDirectorySecurityNtfsDacl -Account $g1 -SecurityDescriptor $tmpSDID -AccessType allow -Rights full_control -ApplyTo  sub_folders, files
&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;But according to the customer this throws an error because of duplicate entries.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a pure Windows Powershell-Environment the customer would handle like this:&lt;/P&gt;
&lt;PRE&gt;$ACL = Get-Acl $Path
# Regel 1 : overwrite existing permissions of $Trustee with new ones
$ar = New-Object system.security.accesscontrol.filesystemaccessrule($Trustee,$Permission,$inhCIOI,$propNone,"Allow")
$ACL.SetAccessRule($ar)

# Regel2: add additional permissions to $Trustee
$ar = New-Object system.security.accesscontrol.filesystemaccessrule($Trustee,$anderePermission,$inhCIOI,$andereProp,"Allow")
$ACL.AddAccessRule($ar)                Set-Acl -Path $Path  -AclObject $ACL
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can we achieve the same with our Powershell SDK?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any input is appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;Tim&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 13:05:33 GMT</pubDate>
    <dc:creator>Tim_Stiller</dc:creator>
    <dc:date>2025-06-04T13:05:33Z</dc:date>
    <item>
      <title>multiple permissions for same trustee - how to realize with powershell</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/multiple-permissions-for-same-trustee-how-to-realize-with-powershell/m-p/144850#M5895</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i got a question from a customer which i'd like to discuss here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$tmpSDID  = "sd01"
$tmpPolID = "pol01"
&lt;BR /&gt;# AAAAA
# create new SD with temp-ID
$sd = New-NcFileDirectorySecurityNtfs     -SecurityDescriptor $tmpSDID&lt;BR /&gt;
# remove default entries from SD-DACL 
# defaults are for Creator/Owner ; nt auth/SYSTEM, builtin\administratros und bziltin\users all with full-control
Get-NcFileDirectorySecurityNtfsDacl -SecurityDescriptor $tmpSDID | Remove-NcFileDirectorySecurityNtfsDacl

# BBBBBB
# add permissions to DACL of the SD
$ace1 = Add-NcFileDirectorySecurityNtfsDacl -Account $g1 -SecurityDescriptor $tmpSDID -AccessType allow -Rights full_control -ApplyTo this_folder, sub_folders, files
$ace2 = Add-NcFileDirectorySecurityNtfsDacl -Account $g2 -SecurityDescriptor $tmpSDID -AccessType allow -Rights full_control -ApplyTo this_folder, sub_folders, files
$ace3 = Add-NcFileDirectorySecurityNtfsDacl -Account $g3 -SecurityDescriptor $tmpSDID -AccessType allow -Rights full_control -ApplyTo this_folder, sub_folders, files

# CCCCCCCCC
# create policy task
$poltsk = Add-NcFileDirectorySecurityPolicyTask -Name $tmpPolID -SecurityType ntfs -NtfsSecurityDescriptor $tmpSDID -Path $Path

# apply policy task
$r = Set-NcFileDirectorySecurity -Name $tmpPolID

# Cleanup of policy task and descriptors, wait 5 seconds to let the netapp digest...
Start-Sleep -Seconds 5
Remove-NcFileDirectorySecurityPolicy -Name $tmpPolID
Remove-NcFileDirectorySecurityNtfs   -Name $tmpSDID
&lt;/PRE&gt;
&lt;P&gt;Everything is fine till here. But the customer asks how to assign multiple permissions to the same trustee, which should work as follows:&lt;/P&gt;
&lt;PRE&gt; $ace1 = Add-NcFileDirectorySecurityNtfsDacl -Account $g1 -SecurityDescriptor $tmpSDID -AccessType allow -Rights read               -ApplyTo   this_folder&lt;BR /&gt; $ace2 = Add-NcFileDirectorySecurityNtfsDacl -Account $g1 -SecurityDescriptor $tmpSDID -AccessType allow -Rights full_control -ApplyTo  sub_folders, files
&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;But according to the customer this throws an error because of duplicate entries.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a pure Windows Powershell-Environment the customer would handle like this:&lt;/P&gt;
&lt;PRE&gt;$ACL = Get-Acl $Path
# Regel 1 : overwrite existing permissions of $Trustee with new ones
$ar = New-Object system.security.accesscontrol.filesystemaccessrule($Trustee,$Permission,$inhCIOI,$propNone,"Allow")
$ACL.SetAccessRule($ar)

# Regel2: add additional permissions to $Trustee
$ar = New-Object system.security.accesscontrol.filesystemaccessrule($Trustee,$anderePermission,$inhCIOI,$andereProp,"Allow")
$ACL.AddAccessRule($ar)                Set-Acl -Path $Path  -AclObject $ACL
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can we achieve the same with our Powershell SDK?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any input is appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;Tim&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 13:05:33 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/multiple-permissions-for-same-trustee-how-to-realize-with-powershell/m-p/144850#M5895</guid>
      <dc:creator>Tim_Stiller</dc:creator>
      <dc:date>2025-06-04T13:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: multiple permissions for same trustee - how to realize with powershell</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/multiple-permissions-for-same-trustee-how-to-realize-with-powershell/m-p/144899#M5896</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FYI in case you&amp;nbsp;escalate it internally. i found that there are two more&amp;nbsp;users reporting this issue:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/NetApp-PowerShell-Toolkit-4-5-released/m-p/136045/highlight/true#M5577" target="_blank"&gt;https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/NetApp-PowerShell-Toolkit-4-5-released/m-p/136045/highlight/true#M5577&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/NetApp-PowerShell-Toolkit-4-5-released/m-p/136806/highlight/true#M5590" target="_blank"&gt;https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/NetApp-PowerShell-Toolkit-4-5-released/m-p/136806/highlight/true#M5590&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gidi&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 09:39:20 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/multiple-permissions-for-same-trustee-how-to-realize-with-powershell/m-p/144899#M5896</guid>
      <dc:creator>GidonMarcus</dc:creator>
      <dc:date>2018-11-27T09:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: multiple permissions for same trustee - how to realize with powershell</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/multiple-permissions-for-same-trustee-how-to-realize-with-powershell/m-p/144902#M5897</link>
      <description>&lt;P&gt;what is the way to get this fixed? Create a case although PSTK is only under community-support?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 09:56:19 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/multiple-permissions-for-same-trustee-how-to-realize-with-powershell/m-p/144902#M5897</guid>
      <dc:creator>Tim_Stiller</dc:creator>
      <dc:date>2018-11-27T09:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: multiple permissions for same trustee - how to realize with powershell</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/multiple-permissions-for-same-trustee-how-to-realize-with-powershell/m-p/144903#M5898</link>
      <description>&lt;P&gt;i'm afraid i don't know - i'm myself a customer.&amp;nbsp; i expect that if it's a&amp;nbsp;reproducible issue it will qualify to a case and a burt. hence i also provided the links to help "building" the case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 10:06:55 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/multiple-permissions-for-same-trustee-how-to-realize-with-powershell/m-p/144903#M5898</guid>
      <dc:creator>GidonMarcus</dc:creator>
      <dc:date>2018-11-27T10:06:55Z</dc:date>
    </item>
  </channel>
</rss>

