• Home
  • PS
  • C#
  • Perl
  • MSSQL
  • MariaDB
  • Linux
  • Docker
  • MacOS
  • PG
  • Exchange Server
  • Windows
  • Other

Mailbox permission export in excel

Details
Written by: po3dno
Category: Exchange Server
Created: 08 June 2021
Hits: 1133
$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 

Exchange Server: Clear AutoDiscover Cache

Details
Written by: po3dno
Category: Exchange Server
Created: 05 April 2018
Hits: 1149

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 } }

Exchange 2013/2016 обновление

Details
Written by: po3dno
Category: Exchange Server
Created: 18 April 2016
Hits: 1059

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 

Exchange photo

Details
Written by: po3dno
Category: Exchange Server
Created: 16 December 2015
Hits: 1074
Set-UserPhoto "Paul Cannon" -PictureData ([System.IO.File]::ReadAllBytes("C:\Users\Administrator\Desktop\PaulCannon.jpg"))

Exchange 2016 удаление

Details
Written by: po3dno
Category: Exchange Server
Created: 08 December 2015
Hits: 1087

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

 

  1. Copy Receive Connectors to a New Exchange Server
  2. Просмотр логов с транспортных серверов Exchange (Get-MessageTrackingLog)
  3. Powershell post image
  4. Пользователи без фотографий в Outlook

Page 1 of 3

  • 1
  • 2
  • 3

Login Form

  • Forgot your password?
  • Forgot your username?

Statistics

  • Users 2
  • Articles 164
  • Articles View Hits 148993