Set SimpleAcl - PPOSHGROUP/PPoShTools GitHub Wiki

Set-SimpleAcl

PPoShTools -> Set-SimpleAcl.ps1

Synopsis

Sets a simple ACL rule for given Path.

Syntax

Set-SimpleAcl [-Path] <String> [-User] <String> [-Permission] <String> [-Type] 
<String> [-Inherit] [-WhatIf] [-Confirm] [<CommonParameters>]

Description

Returns true if an access rule has been added. False if it was already present.

Parameters

-Path<String>

  • PipelineInput: false
  • Required: true

-User<String>

  • PipelineInput: false
  • Required: true

-Permission<String>

  • Valid values: FullControl, Modify, ReadAndExecute, ListDirectory, Read, Write
  • PipelineInput: false
  • Required: true

-Type<String>

  • Valid values: Allow, Deny
  • PipelineInput: false
  • Required: true

-Inherit<SwitchParameter> (default: True)

  • DefaultValue: True
  • PipelineInput: false
  • Required: false

-WhatIf<SwitchParameter>

  • PipelineInput: false
  • Required: false

-Confirm<SwitchParameter>

  • PipelineInput: false
  • Required: false

Examples

Example 1

Set-SimpleAcl -Path 'c:\test' -User 'Everyone' -Permission 'FullControl' -Type 'Allow'
⚠️ **GitHub.com Fallback** ⚠️