- Details
- Written by: po3dno
- Category: Exchange Server
- Hits: 930
$report = @() $Mbxs = Get-Mailbox -Resultsize Unlimited foreach ($Mbx in $Mbxs) { $Owner = Get-Mailbox $Mbx | Get-MailboxPermission -Owner $Manager = Get-ADUser $mbx.SamAccountName -Server domain.com -Properties Manager #| select Name, @{N='Manager';E={(Get-ADUser $_.Manager).name}} $permission = get-mailboxpermission -identity $Mbx |where {$_.user -notlike "*NT AUTHORITY\SELF" -and $_.IsInherited -eq $false}| select @{Name="Displayname"; Expression={(Get-Recipient $_.user.ToString()).Displayname.ToString()}}, @{Name="primarysmtpaddress"; Expression={(Get-Recipient $_.user.ToString()).primarysmtpaddress.ToString()}}, user, @{Name="AccessRights";Expression={$_.AccessRights}}| Select User, name, accessrights $reportObj = New-Object PSObject $reportObj | Add-Member NoteProperty -Name "Mailbox Name" -Value $mbx.name $reportObj | Add-Member NoteProperty -Name "RecipientTypeDetails" -Value $mbx.RecipientTypeDetails $reportObj | Add-Member NoteProperty -Name "Access Rights" -Value $permission.AccessRights $reportObj | Add-Member NoteProperty -Name "Username" -Value $permission.user $reportObj | Add-Member NoteProperty -Name "Owner" -Value $Owner.owner $reportObj | Add-Member NoteProperty -Name "Manager" -Value $Manager.manager $report += $reportObj } $report
- Details
- Written by: po3dno
- Category: Exchange Server
- Hits: 1007
When you change AutoDiscover settings for users, it can take up to 2 hours until the cached data on each Exchange Server is invalidated and the new AutoDiscover configuration is sent as a response to new AutoDiscover request.
You have to force a service and a application pool restart to activate your configuration changes immediately:
- Service: MSExchangeServiceHost
- Application Pool: MSExchangeAutodiscoverAppPool
These restarts need to be performed on each Exchange 2013/2016 server in your infrastructure serving AutoDiscover requests.
Use the following two PowerShell cmdlets to simplify this task:
Get-ExchangeServer | ? { $_.AdminDisplayVersion -like '*15.*'} | % { Invoke-Command -ComputerName $_.Name -ScriptBlock {Restart-WebAppPool MSExchangeAutodiscoverAppPool } }
Get-ExchangeServer | ? { $_.AdminDisplayVersion -like '*15.*'} | % { Invoke-Command -ComputerName $_.Name -ScriptBlock {Restart-Service MSExchangeServiceHost } }
- Details
- Written by: po3dno
- Category: Exchange Server
- Hits: 923
Set-ServerComponentState srv1 –Component HubTransport –State Draining –Requester Maintenance
Redirect-Message -Server srv1 -Target srv2.domain.local -Confirm:$false
Suspend-ClusterNode –Name srv1
Set-MailboxServer srv1 –DatabaseCopyActivationDisabledAndMoveNow $true
Set-ServerComponentState srv1 -Component ServerWideOffline –State InActive –Requester Maintenance
setup.exe /prepareschema /IAcceptExchangeServerLicenseTerms
setup.exe /preparead /IAcceptExchangeServerLicenseTerms
setup.exe /PrepareDomain /IAcceptExchangeServerLicenseTerms
setup.exe /m:upgrade /IAcceptExchangeServerLicenseTerms
Resume-ClusterNode –Name srv1
Set-MailboxServer srv1 –DatabaseCopyAutoActivationPolicy Unrestricted
Set-MailboxServer srv1 –DatabaseCopyActivationDisabledAndMoveNow $false
Set-ServerComponentState srv1 –Component HubTransport –State Active –Requester Maintenance
Set-ServerComponentState srv1 -Component ServerWideOffline –State Active –Requester Maintenance
cd "C:\Program Files\Microsoft\Exchange Server\V15\scripts"
.\RedistributeActiveDatabases.ps1 –DagName DAG1 –BalanceDbsByActivationPreference –confirm: $false
- Details
- Written by: po3dno
- Category: Exchange Server
- Hits: 903
Set-UserPhoto "Paul Cannon" -PictureData ([System.IO.File]::ReadAllBytes("C:\Users\Administrator\Desktop\PaulCannon.jpg"))
- Details
- Written by: po3dno
- Category: Exchange Server
- Hits: 925
1. Удаление автономной адресной книги
Get-OfflineAddressBook | Remove-OfflineAddressBook -confirm:$false -force
2. Удаление арбитражных ящиков
Get-Mailbox -Arbitration | Disable-Mailbox -Arbitration –DisableLastArbitrationMailboxAllowed -confirm:$false
3. Отключение всех ящиков
Get-Mailbox -archive | Disable-Mailbox -confirm:$false
Get-Mailbox -monitoring | Disable-Mailbox -confirm:$false
Get-Mailbox | Disable-Mailbox -confirm:$false
Get-Mailbox -AuditLog | Disable-Mailbox -confirm:$false
4. Удаление базы данных
Get-MailboxDatabase | Remove-MailboxDatabase -confirm:$false