-
Notifications
You must be signed in to change notification settings - Fork 3
Add‐SMBSecurityDACL
Adds a DACL to an SMBSecurityDescriptor.
Add-SMBSecurityDACL [-SecurityDescriptor] <PSObject> [-DACL] <SMBSecDaclAce> [-PassThru] [<CommonParameters>]
Adds a DACL to an SMBSecurityDescriptor.
PS C:\> $SD = Get-SMBSecurity -SecurityDescriptorName SrvsvcDefaultShareInfo
PS C:\> $DACLSplat = @{
SecurityDescriptorName = 'SrvsvcDefaultShareInfo'
Access = 'Allow'
Right = 'FullControl'
Account = 'Authenticated Users'
}
PS C:\> $DACL = New-SMBSecurityDACL @DACLSplat
PS C:\> Add-SMBSecurityDACL -SecurityDescriptor $SD -DACL $DACLThe SrvsvcDefaultShareInfo SMB SecurityDescriptor (SD) is assigned to $SD. A DACL that Allows the "Authenticated Users" special identity group FullControl is create. Then the DACL is then added to the SD. NOTE: This does not save the change to the system. See Save-SMBSecurity.
The DACL being added to the SMBSecurityDescriptor. The DACL must originate from Copy-SMBSecurityDACL or New-SMBSecurityDACL and the DACL's SecurityDescriptor property must match the SecurityDescriptor's Name, because each SMB SecurityDescriptor has a unique set of rights. Attempting to add a DACL with a mismatched SMBSecurityDescriptor will result in an error.
Type: SMBSecDaclAce
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseOutputs the modified SMBSecurityDescriptor to the success stream.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe SMBSecurityDescriptor object where the DACL should be added. The SMBSecurityDescriptor object must originate from Get-SMBSecurity.
Type: PSObject
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
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.
| Development on this project has ended in a pre-release state. Please use with extreme caution! |
| This project can be used AS-IS, with no warranties, guarantees, or support of any kind! A registry setting backup file is created prior to any change being committed. Use that reg file to restore the previous state, then restart the Server (LanmanServer) service to restore the old security state. |
| 📝 NOTE |
|---|
| The -ComputerName parameter is currently not supported! Please use PSRemoting to manage servers remotely. |