Schlagwort-Archive: get-mailboxfolderpermission

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