0

フォルダー名に応じて異なるアクセス許可で、多くのフォルダーにアクセス許可を適用するスクリプトを作成する必要があります。ルート フォルダー共有があり、その中に各クライアントを表すフォルダーがあります。各クライアント フォルダーの内部には、部門フォルダーがあります。各部門のフォルダへのアクセスをセキュリティ グループで制限して、その部門に属する人だけがアクセスできるようにする必要があります。

次のようになります。

ROOT FOLDER SHARE  
|  
|-----CLIENT1 (everyone has access)  
|.......|------DEPARTMENT1 (only members of department1 have access)  
|.......|------DEPARTMENT2 (only members of department2 have access)  
|.......|------DEPARTMENT3 (only members of department3 have access)  
|  
|-----CLIENT2 (everyone has access)  
|.......|------DEPARTMENT1 (only members of department1 have access)  
|.......|------DEPARTMENT2 (only members of department2 have access)  
|.......|------DEPARTMENT3 (only members of department3 have access)  
|  
|-----CLIENT3 (everyone has access)  
........|------DEPARTMENT1 (only members of department1 have access)  
........|------DEPARTMENT2 (only members of department2 have access)  
........|------DEPARTMENT3 (only members of department3 have access)  

これを正しく実行する方法が完全にはわかりません。誰かが私を正しい方向に向けるのを手伝ってもらえますか? これは、Active Directory セットアップを使用して Windows Server 2008 R2 を実行しているサーバー上にあります。

私が現在持っているものは次のようになります(これは機能するようです):

$Path = Read-Host "What is the starting path?"
$DirectoryName = Read-Host "What is the name of the directory?"
$SecurityGroup = Read-Host "What is the name of the security group that will be given permissions on these directories?"
$ListOfDirectories = Get-ChildItem $Path -Recurse | Where-Object { $_.PSIsContainer } | Where-Object { $_.name -eq $DirectoryName } | foreach-object -process { $_.FullName }

foreach ($directory in $ListOfDirectories) {
    icacls.exe $directory /grant ""$SecurityGroup":M" /t
}
4

1 に答える 1

2

Set-ACL コマンドを使用して、PowerShell でアクセス許可の設定を自動化できます。

この作業に役立つ良い記事がここにあります...

http://technet.microsoft.com/en-us/magazine/2008.02.powershell.aspx

于 2013-11-14T10:06:20.400 に答える