Set‐SMBSecurityDACL - microsoft/SMBSecurity GitHub Wiki
Alters the settings of an SMB Security Descriptor (SD) DACL.
Set-SMBSecurityDACL [-DACL] <SMBSecDaclAce> [[-Account] <Object>] [[-Access] <Object>] [[-Right] <String[]>]
[-PassThru] [<CommonParameters>]
Alters the settings of an SMB Security Descriptor (SD) DACL.
PS C:\> $SD = Get-SMBSecurity -SecurityDescriptorName SrvsvcSharePrintInfo
PS C:\> $DACL = $SD.DACL | Where-Object {$_.Account.Username -eq "DomianGroup"}
PS C:\> $NewDACL = Copy-SMBSecurityDACL $DACL
PS C:\> Set-SMBSecurityDACL -DACL $NewDACL -Access DenyCreates the SrvsvcSharePrintInfo SMBSecurityDescriptor and then copies the DACL using the DomainGroup account. The DACL is modified to Deny this group access to SrvsvcSharePrintInfo SD.
Allow or Deny the the Right(s) for the Account. Please note that Deny overrules Allow.
Type: Object
Parameter Sets: (All)
Aliases:
Accepted values: Allow, Deny
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe user account or group that the Right(s) will apply to.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe DACL object being modified.
Type: SMBSecDaclAce
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOutputs the results to the success stream.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseWhat permissions the account will (Allow) or will not (Deny) have for SMB SecurityDescriptor.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.