Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
microsoft_exchange [2026/01/14 10:00] jango [Public Folder] |
microsoft_exchange [2026/01/15 12:17] (aktuell) jango [Public Folder] |
||
|---|---|---|---|
| Zeile 385: | Zeile 385: | ||
| Get-PublicFolder -Recurse -ResultSize Unlimited | Get-PublicFolder -Recurse -ResultSize Unlimited | ||
| + | # Nur Top-Level | ||
| + | Get-PublicFolder -ResultSize Unlimited -Recurse | select Name, | ||
| + | |||
| + | Add-PublicFolderClientPermission -Identity \My-Folder -User test.user -AccessRights Editor|Owner|Publisher | ||
| + | Get-PublicFolderClientPermission -Identity \My-Folder | ||
| + | Remove-PublicFolderClientPermission -Identity \My-Folder -User test.user | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | RunspaceId | ||
| + | Identity | ||
| + | Name : IPM_SUBTREE | ||
| + | MailEnabled | ||
| + | MailRecipientGuid | ||
| + | ParentPath | ||
| + | LostAndFoundFolderOriginalPath : | ||
| + | ContentMailboxName | ||
| + | ContentMailboxGuid | ||
| + | EformsLocaleId | ||
| + | PerUserReadStateEnabled | ||
| + | EntryId | ||
| + | DumpsterEntryId | ||
| + | ParentFolder | ||
| + | OrganizationId | ||
| + | AgeLimit | ||
| + | RetainDeletedItemsFor | ||
| + | ProhibitPostQuota | ||
| + | IssueWarningQuota | ||
| + | MaxItemSize | ||
| + | LastMovedTime | ||
| + | AdminFolderFlags | ||
| + | FolderSize | ||
| + | HasSubfolders | ||
| + | FolderClass | ||
| + | FolderPath | ||
| + | AssociatedDumpsterFolders | ||
| + | DefaultFolderType | ||
| + | ExtendedFolderFlags | ||
| + | MailboxOwnerId | ||
| + | IsValid | ||
| + | ObjectState | ||
| + | </ | ||
| + | |||
| + | bzw. | ||
| + | |||
| + | < | ||
| + | RunspaceId | ||
| + | Identity | ||
| + | Name : DUMMY-Newsletter | ||
| + | MailEnabled | ||
| + | MailRecipientGuid | ||
| + | ParentPath | ||
| + | LostAndFoundFolderOriginalPath : | ||
| + | ContentMailboxName | ||
| + | ContentMailboxGuid | ||
| + | EformsLocaleId | ||
| + | PerUserReadStateEnabled | ||
| + | EntryId | ||
| + | DumpsterEntryId | ||
| + | ParentFolder | ||
| + | OrganizationId | ||
| + | AgeLimit | ||
| + | RetainDeletedItemsFor | ||
| + | ProhibitPostQuota | ||
| + | IssueWarningQuota | ||
| + | MaxItemSize | ||
| + | LastMovedTime | ||
| + | AdminFolderFlags | ||
| + | FolderSize | ||
| + | HasSubfolders | ||
| + | FolderClass | ||
| + | FolderPath | ||
| + | AssociatedDumpsterFolders | ||
| + | DefaultFolderType | ||
| + | ExtendedFolderFlags | ||
| + | MailboxOwnerId | ||
| + | IsValid | ||
| + | ObjectState | ||
| + | </ | ||
| + | |||
| + | ===Test Script=== | ||
| + | |||
| + | <code powershell> | ||
| + | # EWS Config | ||
| + | $MailboxForAutodiscover = " | ||
| + | $UseDefaultCredentials | ||
| + | $EwsCred = Get-Credential | ||
| + | |||
| + | function Get-PublicFolderFolderClassEws { | ||
| + | param([Parameter(Mandatory)][string]$PfPath) | ||
| + | |||
| + | # DLL laden (Standardpfad; | ||
| + | $dll = " | ||
| + | if (-not (" | ||
| + | if (-not (Test-Path $dll)) { return $null } | ||
| + | Add-Type -Path $dll | ||
| + | } | ||
| + | |||
| + | $service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService( | ||
| + | [Microsoft.Exchange.WebServices.Data.ExchangeVersion]:: | ||
| + | ) | ||
| + | |||
| + | if ($UseDefaultCredentials) { | ||
| + | $service.UseDefaultCredentials = $true | ||
| + | } else { | ||
| + | $service.Credentials = New-Object Microsoft.Exchange.WebServices.Data.WebCredentials( | ||
| + | $EwsCred.UserName, | ||
| + | ) | ||
| + | } | ||
| + | |||
| + | $service.AutodiscoverUrl($MailboxForAutodiscover, | ||
| + | |||
| + | $current = [Microsoft.Exchange.WebServices.Data.Folder]:: | ||
| + | $service, [Microsoft.Exchange.WebServices.Data.WellKnownFolderName]:: | ||
| + | ) | ||
| + | |||
| + | foreach ($seg in $PfPath.Trim(" | ||
| + | $view = New-Object Microsoft.Exchange.WebServices.Data.FolderView(100) | ||
| + | $filter = New-Object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo( | ||
| + | [Microsoft.Exchange.WebServices.Data.FolderSchema]:: | ||
| + | ) | ||
| + | $res = $service.FindFolders($current.Id, | ||
| + | if ($res.TotalCount -lt 1) { return $null } | ||
| + | $current = $res.Folders[0] | ||
| + | } | ||
| + | |||
| + | return $current.FolderClass | ||
| + | } | ||
| + | |||
| + | function Show-Subs { | ||
| + | param( | ||
| + | [Parameter(Mandatory)] $ParentEntryId, | ||
| + | [int] $Level = 1 | ||
| + | ) | ||
| + | |||
| + | $subs = Get-PublicFolder -ResultSize Unlimited -Recurse | Where-Object { $_.ParentFolder -eq $ParentEntryId } | ||
| + | |||
| + | foreach ($sub in $subs) { | ||
| + | |||
| + | $perms = Get-PublicFolderClientPermission -Identity $sub.Identity -ErrorAction SilentlyContinue | ||
| + | $owners = $perms | Where-Object { $_.AccessRights -contains " | ||
| + | if (-not $owners) { $owners = "< | ||
| + | $permString = ($perms | ForEach-Object { " | ||
| + | |||
| + | #Write-Host (" | ||
| + | Write-Host (" | ||
| + | Write-Host ("{0}- EntryId: {1}" -f (" | ||
| + | Write-Host ("{0}- ParentFolder: | ||
| + | |||
| + | Write-Host ("{0}- Owner(s): {1}" -f (" | ||
| + | Write-Host ("{0}- Permissions: | ||
| + | |||
| + | $addr = Get-MailPublicFolder -Identity $sub.Identity -ErrorAction SilentlyContinue | ||
| + | if ($addr -and $addr.PrimarySmtpAddress) { | ||
| + | Write-Host ("{0}- Address: {1}" -f (" | ||
| + | } else { | ||
| + | Write-Host ("{0}- Address: ---" -f (" | ||
| + | } | ||
| + | |||
| + | $type = Get-PublicFolderFolderClassEws -PfPath $sub.Identity | ||
| + | if (-not $type) { $type = "< | ||
| + | Write-Host ("{0}- Type: {1}" -f (" | ||
| + | |||
| + | Show-Subs -ParentEntryId $sub.EntryId -Level ($Level + 1) | ||
| + | |||
| + | } | ||
| + | } | ||
| + | |||
| + | Get-PublicFolder -ResultSize Unlimited -Recurse | Where-Object { $_.ParentPath -eq " | ||
| + | | ||
| + | $curr = $_ | ||
| + | | ||
| + | $perms = Get-PublicFolderClientPermission -Identity $curr.Identity -ErrorAction SilentlyContinue | ||
| + | $owners = $perms | Where-Object { $_.AccessRights -contains " | ||
| + | if (-not $owners) { $owners = "< | ||
| + | $permString = ($perms | ForEach-Object { " | ||
| + | |||
| + | #Write-Host " | ||
| + | Write-Host " | ||
| + | Write-Host "`t- EntryId: $($curr.EntryId)" | ||
| + | Write-Host "`t- ParentFolder: | ||
| + | Write-Host ("`t- Owner(s): {0}" -f ($owners -join ', ')) | ||
| + | Write-Host ("`t- Permissions: | ||
| + | |||
| + | try { | ||
| + | $addr = Get-MailPublicFolder -Identity $curr.Identity -ErrorAction SilentlyContinue | ||
| + | if ($addr -and $addr.PrimarySmtpAddress) { | ||
| + | Write-Host ("`t- Address: {0}" -f ($addr.PrimarySmtpAddress)) | ||
| + | } else { | ||
| + | Write-Host ("`t- Address: ---") | ||
| + | } | ||
| + | } catch {} | ||
| + | |||
| + | $type = Get-PublicFolderFolderClassEws -PfPath $curr.Identity | ||
| + | if (-not $type) { $type = "< | ||
| + | Write-Host ("`t- Type: {0}" -f $type) | ||
| + | |||
| + | Show-Subs -ParentEntryId $curr.EntryId -Level 1 | ||
| + | |||
| + | } | ||
| + | </ | ||
| + | ====Mail enabled==== | ||
| + | |||
| + | <code powershell> | ||
| # nur mailaktivierte öffentliche Ordner | # nur mailaktivierte öffentliche Ordner | ||
| Get-MailPublicFolder -ResultSize unlimited | Get-MailPublicFolder -ResultSize unlimited | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | RunspaceId | ||
| + | Contacts | ||
| + | ContentMailbox | ||
| + | DeliverToMailboxAndForward | ||
| + | ExternalEmailAddress | ||
| + | EntryId | ||
| + | OnPremisesObjectId | ||
| + | IgnoreMissingFolderLink | ||
| + | ForwardingAddress | ||
| + | PhoneticDisplayName | ||
| + | AcceptMessagesOnlyFrom | ||
| + | AcceptMessagesOnlyFromDLMembers | ||
| + | AcceptMessagesOnlyFromSendersOrMembers : {} | ||
| + | AddressListMembership | ||
| + | AdministrativeUnits | ||
| + | Alias : EventConfig_NOTES1 | ||
| + | ArbitrationMailbox | ||
| + | BypassModerationFromSendersOrMembers | ||
| + | OrganizationalUnit | ||
| + | CustomAttribute1 | ||
| + | CustomAttribute10 | ||
| + | CustomAttribute11 | ||
| + | CustomAttribute12 | ||
| + | CustomAttribute13 | ||
| + | CustomAttribute14 | ||
| + | CustomAttribute15 | ||
| + | CustomAttribute2 | ||
| + | CustomAttribute3 | ||
| + | CustomAttribute4 | ||
| + | CustomAttribute5 | ||
| + | CustomAttribute6 | ||
| + | CustomAttribute7 | ||
| + | CustomAttribute8 | ||
| + | CustomAttribute9 | ||
| + | ExtensionCustomAttribute1 | ||
| + | ExtensionCustomAttribute2 | ||
| + | ExtensionCustomAttribute3 | ||
| + | ExtensionCustomAttribute4 | ||
| + | ExtensionCustomAttribute5 | ||
| + | DisplayName | ||
| + | EmailAddresses | ||
| + | ; | ||
| + | GrantSendOnBehalfTo | ||
| + | ExternalDirectoryObjectId | ||
| + | HiddenFromAddressListsEnabled | ||
| + | LastExchangeChangedTime | ||
| + | LegacyExchangeDN | ||
| + | MaxSendSize | ||
| + | MaxReceiveSize | ||
| + | ModeratedBy | ||
| + | ModerationEnabled | ||
| + | PoliciesIncluded | ||
| + | PoliciesExcluded | ||
| + | EmailAddressPolicyEnabled | ||
| + | PrimarySmtpAddress | ||
| + | RecipientType | ||
| + | RecipientTypeDetails | ||
| + | RejectMessagesFrom | ||
| + | RejectMessagesFromDLMembers | ||
| + | RejectMessagesFromSendersOrMembers | ||
| + | RequireSenderAuthenticationEnabled | ||
| + | SimpleDisplayName | ||
| + | SendModerationNotifications | ||
| + | UMDtmfMap | ||
| + | WindowsEmailAddress | ||
| + | MailTip | ||
| + | MailTipTranslations | ||
| + | Identity | ||
| + | IsValid | ||
| + | ExchangeVersion | ||
| + | Name : EventConfig_NOTES1 | ||
| + | DistinguishedName | ||
| + | Guid : 3845b437-d154-47ac-b6bf-f3f0b5dedb4b | ||
| + | ObjectCategory | ||
| + | ObjectClass | ||
| + | WhenChanged | ||
| + | WhenCreated | ||
| + | WhenChangedUTC | ||
| + | WhenCreatedUTC | ||
| + | OrganizationId | ||
| + | Id : d2000.local/ | ||
| + | OriginatingServer | ||
| + | ObjectState | ||
| </ | </ | ||
| =====Links===== | =====Links===== | ||