-Path seçeneği
Örnek
Şöyle yaparız
CMD Example:
md testdirectory
Powershell Example:
New-Item -Path "c:\" -Name "testdirectory" -ItemType "directory"
Örnek
$directory = "..."
$myuser="..."
$denieduser="..."
New-Item -Path $directory -ItemType Directory
$acl = Get-Acl -Path $directory
#Give full control to this folder,subfolders and files
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule
($myuser,"FullControl","ContainerInherit, ObjectInherit", "None", "Allow")
$acl.AddAccessRule($rule)
#Deny full control to another user
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule
($denieduser,"FullControl", "Deny")
$acl.AddAccessRule($rule)
#Set owner
$owner=New-Object System.Security.Principal.NTAccount($myuser)
$acl.SetOwner($owner)
Set-Acl $directory $acl | Out-Null
Hiç yorum yok:
Yorum Gönder