フォルダアクセス件の一覧を出力する » 履歴 » バージョン 2
バージョン 1 (蒲池 晃, 2023/05/12 12:48) → バージョン 2/5 (蒲池 晃, 2023/05/12 12:50)
h1. フォルダアクセス件の一覧を出力する
■ フォルダのアクセス権限一覧を出力する
文字コードをUTFで指定
C:\office.csvにデータを出力
上位三階層までを表示する
<pre>
Get-ChildItem -Force -Recurse -Depth 3 | Where-Object { $_.mode -match "d" } | Get-Acl | Select-Object @{Label="Path"; Expression={Convert-Path $_.Path}}, Owner, AccessToString | Export-Csv C:\office.csv -Encoding UTF8
</pre>
Powershellで、調べたい階層まで移動してから実行する
■ active dirctory のグループメンバーリストを出力する
<pre>
Get-ADGroup -Filter *|
select Name, @{Label = "MemberNames"; Expression = {($_| Get-ADGroupMember| select -ExpandProperty Name) -join ","}}|
Format-List
</pre>
■ フォルダのアクセス権限一覧を出力する
文字コードをUTFで指定
C:\office.csvにデータを出力
上位三階層までを表示する
<pre>
Get-ChildItem -Force -Recurse -Depth 3 | Where-Object { $_.mode -match "d" } | Get-Acl | Select-Object @{Label="Path"; Expression={Convert-Path $_.Path}}, Owner, AccessToString | Export-Csv C:\office.csv -Encoding UTF8
</pre>
Powershellで、調べたい階層まで移動してから実行する
■ active dirctory のグループメンバーリストを出力する
<pre>
Get-ADGroup -Filter *|
select Name, @{Label = "MemberNames"; Expression = {($_| Get-ADGroupMember| select -ExpandProperty Name) -join ","}}|
Format-List
</pre>