Skip to content

Set-NtfsSecurity

SYNOPSIS

Manage NTFS security for a specified folder.

SYNTAX

Set-NtfsSecurity [[-folder] <String>] [[-sec] <String>] [[-AcceptDefaultGroup] <Object>] [[-HEATType] <Char>]
 [[-TaskNr] <Int32>] [<CommonParameters>]

DESCRIPTION

This function manages NTFS security for a specified folder. It allows users to define access levels (List, Read, or Write), create or validate Active Directory groups, and assign permissions to the folder. The function also supports HEAT task integration and provides options for adding users to the security group.

EXAMPLES

EXAMPLE 1

Set-NtfsSecurity -folder "\\server\share" -sec "R" -TaskNr 12345

Sets Read permissions for the folder "\\server\share" and associates it with HEAT task 12345.

EXAMPLE 2

Set-NtfsSecurity -folder "\\server\share" -sec "W" -AcceptDefaultGroup -TaskNr 67890

Sets Write permissions for the folder "\\server\share", automatically accepts the suggested group name, and associates it with HEAT task 67890.

EXAMPLE 3

Set-NtfsSecurity -folder "\\server\share" -sec "L"

Sets List permissions for the folder "\\server\share".

PARAMETERS

-folder

The UNC path of the folder for which NTFS security will be managed.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-sec

The access level to assign to the folder. Valid values are: - L: List - R: Read - W: Write

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AcceptDefaultGroup

A switch to automatically accept the suggested group name without prompting.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-HEATType

The type of HEAT task. Valid values are: - T: Task - R: Request - C: Call

Type: Char
Parameter Sets: (All)
Aliases: InfraType

Required: False
Position: 4
Default value: T
Accept pipeline input: False
Accept wildcard characters: False

-TaskNr

The HEAT task number associated with the operation.

Type: Int32
Parameter Sets: (All)
Aliases: InfraNr

Required: False
Position: 5
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES