0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【PowerShell】指定したフォルダのNTFSアクセス許可を取得するスクリプト

Last updated at Posted at 2025-02-04

上位層のフォルダのNTFSアクセス許可を取得したい時によく利用しているPower Shellスクリプトです。

#NTFSアクセス許可を取得したいフォルダ
$path = "¥¥Folder"

#$pathから何階層までNTFSアクセス許可を取得するか
#0だと、指定したフォルダから1つ下の階層まで
#1だと、指定したフォルダから2つ下の階層まで
$depth = 0

#結果の出力先
$result = "¥¥Folder/faile.csv

#NTFSアクセス許可を取得する
Get-ChildItem -Recurse -Depth $depth $path | Get-Acl | Select-object @{label="Path";Expression={Convert-Path $_.Path}},AccessToString | Export-Csv $result -encoding Default
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?