PackageDeployment Module Help

Package Deployment Module

Set-NtfsSecurity Cmdlet

Version 4.0.0.5

Set-NtfsSecurity

Synopsis

Change NTFS Permissions on NTFS Partitions

Syntax

Set-NtfsSecurity [-Path] <String> [[-Files] <String>] [[-Mode] <String>] [-ContinueOnError] [-KeepInherited] [-SetDirectory] [-SetFiles] [-SetSubDirectories] [-Wow64] [[-AccountRights] <String[]>] [[-Context] <String>] [<CommonParameters>]

Description

Use this command to change the access permissions at directory and file level in NTFS partitions for local drives and shared network directories.

Parameters

-AccountRights <String[]>

Enter the users or groups in this list you want to add to, remove from or replace in the access permissions.

Required

False

Position

3

Accepts pipeline input

False

-Context <String>

User: Execution under user account; logging in HKEY_CURRENT_USER, i.e. for the user.
UserPerService: User-related command, execution in Service context.
Computer: Execution under user account; logging in HKEY_CURRENT_MACHINE, i.e. for the computer.
ComputerPerService: Execution in service context; logging in HKEY_LOCAL_MACHINE, i.e. for the computer.

Required

False

Position

4

Accepts pipeline input

False

-ContinueOnError <SwitchParameter>

Continues script execution in spite of errors in the respective command

Required

False

Position

Named

Accepts pipeline input

False

-Files <String>

In the Files text box you can enter the required file specifications.
Enter a blank, a semi-colon, a dot or inverted commas to separate multiple file name specifications. Please also note the following: If the file name contains blanks or dots already each file name should be entered in inverted commas to guarantee exact identification.
If you want to specify individual permissions for files and directories separately, specify each permission using an individual command.

Required

False

Position

1

Accepts pipeline input

False

-KeepInherited <SwitchParameter>

Leaves the permissions for all newly created files (file inherit ACE) of the selected directory as is, regardless of the new directory permissions (container ACE).

Required

False

Position

Named

Accepts pipeline input

False

-Mode <String>

Reset: Use this option to add the entries from the user and group list to the existing access permissions. If a user or a group already has an inherited access permission, the system changes it to a local access permission. All of the other inherited access permissions are changed accordingly to local access permissions.
Add: With this option you can add the entries from the user and group list to the local access permissions and/or change them. Inherited access permissions that already exist for a user or a group remain without being changed.
Remove: The permissions that exist for entries on the user or group list are removed from the existing access permissions. If a user or a group already has an inherited access permission, the system changes it to a local access permission. All of the other inherited access permissions are changed accordingly to local access permissions.
Set: The entries from the user and group list replace the existing access permissions completely.

Required

False

Position

2

Accepts pipeline input

False

-Path <String>

Specify the name of the directory you want to change the access permissions.

Required

True

Position

0

Accepts pipeline input

False

-SetDirectory <SwitchParameter>

Changes the access permissions at directory level. The changes have no effect on the access permissions of existing files.

Required

False

Position

Named

Accepts pipeline input

False

-SetFiles <SwitchParameter>

Changes the access permissions at file level.

Required

False

Position

Named

Accepts pipeline input

False

-SetSubDirectories <SwitchParameter>

Changes the access permissions of all subdirectories.

Required

False

Position

Named

Accepts pipeline input

False

-Wow64 <SwitchParameter>

By default, the PackageDeployment module assumes to run in a 64-bit PowerShell process on 64-bit systems, and therefore defaults to the 64-bit application location (if different from the 32-bit application location) for file and registry accesses. If you want to access the 32-bit counterparts (in the file system %WinDir%\SysWOW64 instead of %WinDir%\System32, in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node instead of HKEY_LOCAL_MACHINE\SOFTWARE), use the -Wow64 switch.

Required

False

Position

Named

Accepts pipeline input

False

<CommonParameters>

For more information about common parameters, type "Get-Help about_CommonParameters".