Exchangepowershell
Connect to O365 Exchange
| |
Then to close the session
| |
Hide O365 group from GAL ( as this cannot be done on admin portal )
| |
Install the exchange online management module
| |
Connect to Remote Exchange Shell
Use the following commands to connect to an exchange server using powershell:
| |
Handy Commands for Exchange Powershell
- Add permission to calendar:
- This will give a user permissions to another calendar
| |
- Send on Behalf
- This will grant Charles permissions to send on behalf of Gert.
| |
- Send As
- This will grant Charles permissions to send as Gert.
| |
- Full Mailbox Access
- This will grant Charles full access to Gert’s mailbox.
| |
Add full access permission to all mailboxes to an account:
| |
Add Send as permissions to mailboxes:
| |
Get all disconnected mailboxes:
| |
Reconnect Mailbox:
| |
Get mailbox sizes
| |
==Exchange Certificates== Get and assign exchange certificates
| |
| |
Update send and receive connector certificates:
Find out what connectors may need updating with new certificate:
| |
| |
Get new certificate:
| |
Get details required for send/receive connector format:
| |
Set the certificate for send/receive connector
| |
== Exchange issues Powershell==
Get active backend components
| |
Get Mail Queue
| |
Check event viewer for Backpressure events: 15004 15005 15006 15007
| |
Check the Database availability groups cmdlet - use to find out if exchange server is the Primary or Secondary
| |
You can get all the details you need by using the following command:
| |
Sometimes the witness will fail, you can check the status of the witness by using the cluster resource cmdlet:
| |
This will tell you where the witness stores the file. If the DAG finds the resource unrelibale it might mark it as failed - you can restart this by using start-cluster resource:
| |
Get the log for the cluster
| |
Set remote mailbox for hybrid / shared mailboxes
For when there is on-prem and O365 mailboxes
- Need a local user in domain for the shared mailbox for permissions
In Office 365:
| |
In Exchange on-premise powershell:
| |
| |
Add O365 mailbox to local exchange
When a hybrid deployment has shared mailboxes created in O365 there can be issues if on-prem devices try to use the mailboxes. This is because there is no AD object for the mailbox on the local exchange. You will need to create a new remote mailbox object in the on-prem exchange server:
| |
==Exchange online issues==
Clear old problems with hybrid exchange conflicts by removing old mailbox configurations from user objects:
Log into exchange online with connect-exchangeonline:
| |
Exchange message tracking logs
on the on prem exchange server you can use the following cmdlet to check the exchange message logs for the last two hours:
| |