Showing posts with label Exchange. Show all posts
Showing posts with label Exchange. Show all posts

Friday, January 15, 2021

How to copy old user’s mailbox to another user’s mailbox on Office 365 and Exchange Server using PowerShell

If you are an Exchange administrator then you will come across the issue with leavers mailboxes needing to be transfered to another users mailbox. If you are looking after on-site exchange, then the process is slightly shorter as you don’t need to connect to the remote powershell. You simply log in to one of you exchange servers and run PowerShell as Administrator. Then you run following command and check all completed correctly:

Search-Mailbox -Identity “Old User” -TargetMailbox “Current User” -TargetFolder “Old-Mailbox” -LogLevel Full

To do the same on Office 365 you need to connect to remote PowerShell.

Make sure your account is enabled for remote PowerShell. You will need to be a member of Office 365 Global Admins or you will need to ask one of the Global Admin users to enable remote powershell by running following command on the Remote PowerShell:

Set-User user@contoso.com -RemotePowerShellEnabled $true

Check TCP port 80 is open between your PC and Office 365

Run PowerShell on your computer as Administrator

First of all you will need to set your execution policy to Remote Signed

Set-ExecutionPolicy RemoteSigned

Then save youre credentials into a variable for later use, you will be prompted to insert them

$usercredential = Get-Credential

jnow we will save our session to a variable

$session = New-PSSession -configurationname Microsoft.Exchange -connectionUri https://outlook.office365.com/powershell/ -credential $usercredential -authentication Basic -allowredirection

And then we will import it 

Import-PSSession $session

Now we can execute any commands we require, so in our case we want to transfer messages from one users mailbox to another, which is identical to the on-site exchange

Search-Mailbox -Identity “Old User” -TargetMailbox “Current User” -TargetFolder “Old-Mailbox” -LogLevel Full

Sunday, August 30, 2020

Find email address in Active Directory

  1. Open Active Directory Users and Computers
  2. Select your domain name > click on Find Objects... > select Custom Search > Advanced
  3. In Enter LDAP query field type: (proxyAddresses=smtp:email@domain.com)
  4. Press Find Now
  5. You can also use wildcards, i.e. (proxyAddresses=smtp:email*)

Thursday, February 21, 2019

How to move system mailboxes to a new mail database

Moving Arbitration Mailboxes (System Mailbox , FederatedEmail)

Run the following command in Echxange Management Shell to list all system mailboxes

Get-Mailbox -Arbitration -Database "Current Database name"



Run the following command to move those mailboxes to a new database

Get-Mailbox -Arbitration -Database "Current Database name" | New-MoveRequest -TargetDatabase "New Database Name"



Friday, January 20, 2017

How to manually remove an Exchange server from Active Directory

There are some instances where an uninstalled Exchange server still hangs around Active Directory. To manually remove it do the following:

Connect to a domain controller -- probably best to connect to the PDC emulator
Launch the run box (Windows Key + R)
Type in the command “adsiedit.msc” and click “OK”
Right click on the console then “Connect to:”
In the connection dialog select “Well known Naming Context”
In the drop down menu select “Configuration”
Explode “CN=Configuration [domain]\CN=Services\CN=Microsoft Exchange\CN=[organization]\CN=Administrative Groups\CN=Servers”
Right click on the dead server and pick “Delete”

You also need to delete Database information as well

Navigate to “CN=Configuration [domain]\CN=Services\CN=Microsoft Exchange\CN=[organization]\CN=Administrative Groups\CN=Databases”
Explore each item to find wich one is related to the old server, then delete it as well.

Tuesday, March 29, 2016

Disable Exchange resource booking


Launch Exchange Management Shell (PowerShell). Type in the following command to check the current policies assigned to the resource:

get-calendarprocessing -identity "ResourceName" | fl *policy*

You will see results similar to these:

RequestOutOfPolicy    : {}
AllRequestOutOfPolicy : True
BookInPolicy              : {}
AllBookInPolicy          : True
RequestInPolicy         : {}
AllRequestInPolicy     : False

To disable booking for the resource type in the following command:

set-calendarprocessing -identity "ResourceName" -allbookinpolicy:$false

*ResourceName is the actual name of the resource mailbox

Tuesday, July 21, 2015

How to fail over an Exchange database using PowerShell


Update-MailboxDatabaseCopy "DB_NAME\SERVER_NAME" -CatalogOnly

Update-MailboxDatabaseCopy "MB-HO-03\HO-EX2010-MB1" -CatalogOnly

Get-MailboxDatabaseCopyStatus | fl name, contentindexstate

Move-ActiveMailboxDatabase DB_NAME -ActivateOnServer SERVER_NAME -SkipClientExperienceChecks

Move-ActiveMailboxDatabase MB-HO-03 -ActivateOnServer HO-EX2010-MB2 -SkipClientExperienceChecks

Wednesday, January 14, 2015

Some rules are disabled, and you receive an error message when you try to create or enable rules in Outlook

If your mailbox is on Exchange Server 2007 or later, you can ask your Exchange administrator to increase the rules quota for your mailbox. 

The following example command sets the rules quota to the maximum value of 256 KB.

Set-Mailbox john@contoso.com -RulesQuota:256kb

The following example command allows you to view the current rules quota for a mailbox.

Get-Mailbox john@contoso.com |FL displayname, rulesquota

Friday, October 4, 2013

Check and change mailbox permissions using Exchange Management Shell

**List all permissions to a cpecific mailbox
Get-MailboxPermission -Identity "username" | Select User, AccessRights

**Grant full access to an exchange mailbox
Add-MailboxPermission "mailbox_name" -User "user_ID" -AccessRights FullAccess

**Remove full access to an exchange mailbox
Remove-MailboxPermission "mailbox_name" -User "user_ID" -AccessRights FullAccess