Benutzer-Werkzeuge

Webseiten-Werkzeuge


microsoft_exchange

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
microsoft_exchange [2026/01/14 10:26]
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 mailaktivierte öffentliche Ordner +Nur Top-Level 
-Get-MailPublicFolder -ResultSize unlimited+Get-PublicFolder -ResultSize Unlimited -Recurse | select Name,ParentPath | where-object { $_.ParentPath -eq "\"
 + 
 +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
 </code> </code>
  
-<code powershell+<code> 
-Get-PublicFolder -Recurse -ResultSize Unlimited | ForEach-Object  +RunspaceId                     : f6622ea7-e6d2-4528-97b1-036c9298cf3d 
-+Identity                       : \ 
-    $fp = $_.Identity +Name                           : IPM_SUBTREE 
-    Get-PublicFolderClientPermission -Identity $fp -ErrorAction SilentlyContinue | Select @{n="Folder";e={$fp}},User,AccessRights +MailEnabled                    : False 
-}+MailRecipientGuid              : 
 +ParentPath                     : 
 +LostAndFoundFolderOriginalPath : 
 +ContentMailboxName             : PFMailbox1 
 +ContentMailboxGuid             : 442dc65a-3bbc-471e-afcd-b0244b273847 
 +EformsLocaleId                 : 
 +PerUserReadStateEnabled        : True 
 +EntryId                        : 000000001A447390AA6611CD9BC800AA002FC45A0300047699F147FA0A4B891FFFB0825125790000000000020000 
 +DumpsterEntryId                : 000000001A447390AA6611CD9BC800AA002FC45A0300FF1CBA839DBE6F42B05F589E5BA643340000000000020000 
 +ParentFolder                   : 000000001A447390AA6611CD9BC800AA002FC45A0300047699F147FA0A4B891FFFB0825125790000000000010000 
 +OrganizationId                 : 
 +AgeLimit                       : 
 +RetainDeletedItemsFor          : 
 +ProhibitPostQuota              : Unlimited 
 +IssueWarningQuota              : Unlimited 
 +MaxItemSize                    : Unlimited 
 +LastMovedTime                  : 
 +AdminFolderFlags               : 
 +FolderSize                     : 0 
 +HasSubfolders                  : True 
 +FolderClass                    : 
 +FolderPath                     : {} 
 +AssociatedDumpsterFolders      : 
 +DefaultFolderType              : None 
 +ExtendedFolderFlags            : SharedViaExchange 
 +MailboxOwnerId                 : domain.local/Users/PFMailbox1 
 +IsValid                        : True 
 +ObjectState                    : Unchanged
 </code> </code>
 +
 +bzw.
 +
 +<code>
 +RunspaceId                     : f6622ea7-e6d2-4528-97b1-036c9298cf3d
 +Identity                       : \DUMMY-Newsletter
 +Name                           : DUMMY-Newsletter
 +MailEnabled                    : True
 +MailRecipientGuid              : 2956ec64-1f20-4ee6-a5f2-dbeb2c10b5b1
 +ParentPath                     : \
 +LostAndFoundFolderOriginalPath :
 +ContentMailboxName             : PFMailbox2
 +ContentMailboxGuid             : 70c4457e-a502-4170-bf73-fcb4f17cce2c
 +EformsLocaleId                 :
 +PerUserReadStateEnabled        : True
 +EntryId                        : 000000001A447390AA6611CD9BC800AA002FC45A0300822DFDE48134CA4A9BB7E1548BC7FBD90000000559DC0000
 +DumpsterEntryId                : 000000001A447390AA6611CD9BC800AA002FC45A0300FF1CBA839DBE6F42B05F589E5BA643340000000000100000
 +ParentFolder                   : 000000001A447390AA6611CD9BC800AA002FC45A0300047699F147FA0A4B891FFFB0825125790000000000020000
 +OrganizationId                 :
 +AgeLimit                       :
 +RetainDeletedItemsFor          :
 +ProhibitPostQuota              : Unlimited
 +IssueWarningQuota              : Unlimited
 +MaxItemSize                    : Unlimited
 +LastMovedTime                  : 06.10.2023 13:55:05
 +AdminFolderFlags               :
 +FolderSize                     : 0
 +HasSubfolders                  : False
 +FolderClass                    : IPF.Note
 +FolderPath                     : {DUMMY-Newsletter}
 +AssociatedDumpsterFolders      :
 +DefaultFolderType              : None
 +ExtendedFolderFlags            : SharedViaExchange, SharedExchangeEver, SharedExchangeWrite, SharedExchangeWriteEver, SharedExchangeValid
 +MailboxOwnerId                 : d2000.local/Users/PFMailbox1
 +IsValid                        : True
 +ObjectState                    : Unchanged
 +</code>
 +
 +===Test Script===
  
 <code powershell> <code powershell>
-Map nach DisplayName +EWS Config 
-$mailMap = @{} +$MailboxForAutodiscover "manuel.zarat@akm.at"   # nur für Autodiscover 
-Get-MailPublicFolder -ResultSize Unlimited | ForEach-Object { +$UseDefaultCredentials  = $false                    # Wenn als Mailbox in Windows angemeldet 
-    $key = ($_.Name -replace '\s','').ToLower() +$EwsCred = Get-Credential                        # wenn keine DefaultCreds 
-    $mailMap[$key$_+ 
 +function Get-PublicFolderFolderClassEws { 
 +    param([Parameter(Mandatory)][string]$PfPath) 
 + 
 +    # DLL laden (Standardpfad; Versionsabhängig?
 +    $dll = "$env:ProgramFiles\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll" 
 +    if (-not ("Microsoft.Exchange.WebServices.Data.ExchangeService" -as [type])) { 
 +        if (-not (Test-Path $dll)) { return $null 
 +        Add-Type -Path $dll 
 +    } 
 + 
 +    $service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService( 
 +        [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2013_SP1 
 +    ) 
 + 
 +    if ($UseDefaultCredentials) { 
 +        $service.UseDefaultCredentials = $true 
 +    } else { 
 +        $service.Credentials New-Object Microsoft.Exchange.WebServices.Data.WebCredentials( 
 +            $EwsCred.UserName$EwsCred.GetNetworkCredential().Password 
 +        ) 
 +    } 
 + 
 +    $service.AutodiscoverUrl($MailboxForAutodiscover, { $true }) 
 + 
 +    $current = [Microsoft.Exchange.WebServices.Data.Folder]::Bind( 
 +        $service, [Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::PublicFoldersRoot 
 +    ) 
 + 
 +    foreach ($seg in $PfPath.Trim("\").Split("\") | Where-Object { $_ }) { 
 +        $view   = New-Object Microsoft.Exchange.WebServices.Data.FolderView(100) 
 +        $filter = New-Object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo( 
 +            [Microsoft.Exchange.WebServices.Data.FolderSchema]::DisplayName, $seg 
 +        ) 
 +        $res = $service.FindFolders($current.Id, $filter, $view) 
 +        if ($res.TotalCount -lt 1) { return $null } 
 +        $current = $res.Folders[0] 
 +    } 
 + 
 +    return $current.FolderClass
 } }
  
-# Stats +function Show-Subs 
-$statsMap = @{} +    param( 
-Get-PublicFolderStatistics -ResultSize Unlimited | +        [Parameter(Mandatory)] $ParentEntryId, 
-  ForEach-Object { $statsMap[($_.Name -replace '\s','').ToLower()] = $_ }+        [int$Level 
 +    )
  
-# Combine everything +    $subs = Get-PublicFolder -ResultSize Unlimited -Recurse Where-Object { $_.ParentFolder -eq $ParentEntryId }
-Get-PublicFolder -Recurse -ResultSize Unlimited | ForEach-Object { +
-    $key = ($_.Name -replace '\s','').ToLower() +
-    $m  = $mailMap[$key] +
-    $st = $statsMap[$key]+
  
-    $mailEnabled = [bool]$m +    foreach ($sub in $subs) {
-    $smtp        = if ($m) { $m.PrimarySmtpAddress } else { $null } +
-    $alias       = if ($m) { $m.Alias } else { $null }+
  
-    $store = $null +        $perms Get-PublicFolderClientPermission -Identity $sub.Identity -ErrorAction SilentlyContinue 
-    if ($st) { +        $owners = $perms | Where-Object { $_.AccessRights -contains "Owner" } | Select-Object -ExpandProperty User -ErrorAction SilentlyContinue 
-        foreach ($p in 'ContentMailboxName','ContentMailbox','Database') { +        if (-not $owners) { $owners = "<none>" } 
-            if ($st.PSObject.Properties.Name -contains $p) { $store = $st.$p; break +        $permString = ($perms | ForEach-Object { "$($_.User):$($_.AccessRights -join ',')" }) -join '; ' 
-        }+ 
 +        #Write-Host ("{0}{1} => [E]{2} => [P]{3}" -f ("`t" * $Level)$sub.Name, $sub.EntryId, $sub.ParentFolder) 
 +        Write-Host ("{0}{1}" -f ("`t" * $Level), $sub.Name) 
 +        Write-Host ("{0}- EntryId: {1}" -f ("`t" * $Level), $sub.EntryId) 
 +        Write-Host ("{0}- ParentFolder: {1}" -f ("`t" * $Level), $sub.ParentFolder) 
 +  
 +        Write-Host ("{0}- Owner(s): {1}" -f ("`t" * ($Level + 1)), ($owners -join '')
 +        Write-Host ("{0}- Permissions: {1}" -f ("`t" * ($Level + 1)), $permString) 
 +  
 + $addr = Get-MailPublicFolder -Identity $sub.Identity -ErrorAction SilentlyContinue 
 + if ($addr -and $addr.PrimarySmtpAddress) { 
 + Write-Host ("{0}- Address: {1}" -f ("`t" * ($Level + 1)), $addr.PrimarySmtpAddress) 
 + } else { 
 + Write-Host ("{0}- Address: ---" -f ("`t" * ($Level + 1))) 
 +
 +  
 + $type Get-PublicFolderFolderClassEws -PfPath $sub.Identity 
 + if (-not $type) { $type = "<unknown>" 
 + Write-Host ("{0}- Type: {1}" -f ("`t" * ($Level + 1)), $type) 
 +  
 +        Show-Subs -ParentEntryId $sub.EntryId -Level ($Level + 1) 
 +
     }     }
 +}
 +
 +Get-PublicFolder -ResultSize Unlimited -Recurse | Where-Object { $_.ParentPath -eq "\" } | Select-Object Name, EntryId, ParentFolder, Identity | ForEach-Object {
 +    
 + $curr = $_
 +    
 + $perms = Get-PublicFolderClientPermission -Identity $curr.Identity -ErrorAction SilentlyContinue
 +    $owners = $perms | Where-Object { $_.AccessRights -contains "Owner" } | Select-Object -ExpandProperty User -ErrorAction SilentlyContinue
 +    if (-not $owners) { $owners = "<none>" }
 +    $permString = ($perms | ForEach-Object { "$($_.User):$($_.AccessRights -join ',')" }) -join '; '
 +
 +    #Write-Host "$($curr.Name) => [E]$($curr.EntryId) => [P]$($curr.ParentFolder)"
 +    Write-Host "$($curr.Name)"
 +    Write-Host "`t- EntryId: $($curr.EntryId)"
 +    Write-Host "`t- ParentFolder: $($curr.ParentFolder)"
 +    Write-Host ("`t- Owner(s): {0}" -f ($owners -join ', '))
 +    Write-Host ("`t- Permissions: {0}" -f $permString)
 +
 + 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 = "<unknown>" }
 + Write-Host ("`t- Type: {0}" -f $type)
 +
 +    Show-Subs -ParentEntryId $curr.EntryId -Level 1
 +
 +}
 +</code>
 +====Mail enabled====
 +
 +<code powershell>
 +# nur mailaktivierte öffentliche Ordner
 +Get-MailPublicFolder -ResultSize unlimited
 +</code>
  
-    Get-PublicFolderClientPermission -Identity $_.Identity -ErrorAction SilentlyContinue | +<code> 
-      Select-Object ` +RunspaceId                             : f6622ea7-e6d2-4528-97b1-036c9298cf3d 
-        @{n="FolderPath";e={$_.Identity}}, +Contacts                               : {} 
-        @{n="StoreMailboxOrDB";e={$store}}, +ContentMailbox                         : 
-        @{n="MailEnabled";e={$mailEnabled}}, +DeliverToMailboxAndForward             : False 
-        @{n="PrimarySmtpAddress";e={$smtp}}, +ExternalEmailAddress                   : expf:EVENTCONFIG_NOTES1D8919E34D8919E34D8919E34499209C7000011 
-        @{n="Alias";e={$alias}}, +EntryId                                : 
-        User, +OnPremisesObjectId                     : 
-        @{n="AccessRights";e={($_.AccessRights -join ",")}+IgnoreMissingFolderLink                : False 
-} | Out-GridView+ForwardingAddress                      : 
 +PhoneticDisplayName                    : 
 +AcceptMessagesOnlyFrom                 : {} 
 +AcceptMessagesOnlyFromDLMembers        {
 +AcceptMessagesOnlyFromSendersOrMembers : {} 
 +AddressListMembership                  : {
 +AdministrativeUnits                    : {
 +Alias                                  : EventConfig_NOTES1 
 +ArbitrationMailbox                     : 
 +BypassModerationFromSendersOrMembers   : {} 
 +OrganizationalUnit                     : d2000.local/Microsoft Exchange System Objects 
 +CustomAttribute1                       : 
 +CustomAttribute10                      : 
 +CustomAttribute11                      : 
 +CustomAttribute12                      : 
 +CustomAttribute13                      : 
 +CustomAttribute14                      : 
 +CustomAttribute15                      : 
 +CustomAttribute2                       : 
 +CustomAttribute3                       : 
 +CustomAttribute4                       : 
 +CustomAttribute5                       : 
 +CustomAttribute6                       : 
 +CustomAttribute7                       : 
 +CustomAttribute8                       : 
 +CustomAttribute9                       : 
 +ExtensionCustomAttribute1              : {
 +ExtensionCustomAttribute2              : {
 +ExtensionCustomAttribute3              : {} 
 +ExtensionCustomAttribute4              : {} 
 +ExtensionCustomAttribute5              : {} 
 +DisplayName                            : EventConfig_NOTES1 
 +EmailAddresses                         : {smtp:EventConfig_NOTES1@domain.co.atSMTP:EventConfig_NOTES1@domain.at, X400:C=AT;A= 
 +                                         ;P=DUMMY;O=D003A2;S=EventConfig?NOTES1;, FAXMAKER:EventConfig_AKMNOTES1@D003A2.DUMMY.com} 
 +GrantSendOnBehalfTo                    : {
 +ExternalDirectoryObjectId              : 
 +HiddenFromAddressListsEnabled          : True 
 +LastExchangeChangedTime                : 
 +LegacyExchangeDN                       : /o=DUMMY1/ou=D003A2/cn=Recipients/cn=EVENTCONFIG_NOTES1D8919E34D8919E34D8919E34499209C7000011 
 +MaxSendSize                            : Unlimited 
 +MaxReceiveSize                         : Unlimited 
 +ModeratedBy                            : {} 
 +ModerationEnabled                      : False 
 +PoliciesIncluded                       : {87675609-8fa3-4aaf-af06-68bb88d36b4e{26491cfc-9e50-4857-861b-0cb8df22b5d7}} 
 +PoliciesExcluded                       : {} 
 +EmailAddressPolicyEnabled              : True 
 +PrimarySmtpAddress                     : EventConfig_NOTES1@domain.at 
 +RecipientType                          : PublicFolder 
 +RecipientTypeDetails                   : PublicFolder 
 +RejectMessagesFrom                     : {
 +RejectMessagesFromDLMembers            : {} 
 +RejectMessagesFromSendersOrMembers     : {
 +RequireSenderAuthenticationEnabled     : False 
 +SimpleDisplayName                      : 
 +SendModerationNotifications            : Always 
 +UMDtmfMap                              : {} 
 +WindowsEmailAddress                    : EventConfig_NOTES1@domain.at 
 +MailTip                                : 
 +MailTipTranslations                    : {
 +Identity                               : d2000.local/Microsoft Exchange System Objects/EventConfig_NOTES1 
 +IsValid                                : True 
 +ExchangeVersion                        : 0.0 (6.5.6500.0) 
 +Name                                   : EventConfig_NOTES1 
 +DistinguishedName                      : CN=EventConfig_NOTES1,CN=Microsoft Exchange System Objects,DC=d2000,DC=local 
 +Guid                                   : 3845b437-d154-47ac-b6bf-f3f0b5dedb4b 
 +ObjectCategory                         : d2000.local/Configuration/Schema/ms-Exch-Public-Folder 
 +ObjectClass                            : {toppublicFolder
 +WhenChanged                            : 06.05.2024 12:20:17 
 +WhenCreated                            : 21.05.2002 13:06:02 
 +WhenChangedUTC                         : 06.05.2024 10:20:17 
 +WhenCreatedUTC                         : 21.05.2002 11:06:02 
 +OrganizationId                         : 
 +Id                                     : d2000.local/Microsoft Exchange System Objects/EventConfig_NOTES1 
 +OriginatingServer                      : dc02.d2000.local 
 +ObjectState                            : Changed
 </code> </code>
 =====Links===== =====Links=====
microsoft_exchange.1768382787.txt.gz · Zuletzt geändert: 2026/01/14 10:26 von jango