Schlagwort-Archive: permissions

Windows change access permissions from the command line

CACLS files /e /p {USERNAME}:{PERMISSION}

Where,

  • /p : Set new permission
  • /e : Edit permission and kept old permission as it is i.e. edit ACL instead of replacing it.
  • {USERNAME} : Name of user
  • {PERMISSION} : Permission can be:
    • R – Read
    • W – Write
    • C – Change (write)
    • F – Full control

For example grant Rocky Full (F) control with following command (type at Windows command prompt):

C:> CACLS files /e /p rocky:f

Read complete help by typing following command:

C:> cacls /?

Quelle: Windows change access permissions from the command line

Kalenderberechtigungen für eine Gruppe anzeigen

$groupmembers = Get-ADGroupMember -Identity Groupname
$result=@()
Foreach ($member in $groupmembers){
$user = get-aduser $member.samaccountname -Properties *
$sam = $member.samaccountname
$email = $user.EmailAddress
$name = $user.DisplayName
$right = Get-MailboxFolderPermission $email“:\Kalender“ -User Default -ErrorAction SilentlyContinue | select AccessRights
if ($right -eq $null){$right =  Get-MailboxFolderPermission $email“:\Calendar“ -User Default -ErrorAction SilentlyContinue | select AccessRights}
if ($right -eq $null){$right = „nix“}else{$right = $right.AccessRights[0]}
$exserver = $user.msExchHomeServerName
if ($exserver -eq $null){$exserver = „“}
$dings = new-Object PSObject -Property @{
user = $email
homeserver = $exserver
right = $right
sam = $sam
name = $name}
$result += $dings
}
$result | Out-GridView