quarta-feira, 25 de novembro de 2015

How to Defrag an Exchange 2010 Mailbox Database

 

http://exchangeserverpro.com/defrag-exchange-2010-mailbox-database/

 

Exchange Server 2010 mailbox databases grow in size as the data within them grows. But they will never shrink when data is removed from them.

For example if you have a 20Gb mailbox database file and move 4Gb worth of mailboxes to another database, the file will remain at 20Gb in size.

However, the database itself will have 4Gb of “white space” in it, which is space that is available for new data to be written without growing the size of the file.

Your options to reclaim that space are to either:

  • Create a new mailbox database and move all the mailboxes to that database
  • Perform an offline defrag of the existing database to shrink the file

Each option has pros and cons. An offline defrag involves an outage for all users on that database, but may be more convenient if there is not additional storage available to allocate to the Exchange server to hold the new database.

On the other hand a mailbox migration has fewer risks, can be less disruptive as a whole, but will generate a lot of transaction logging that needs to be kept under control so it may take longer (ie several nights/weekends to migrate) as opposed to just one outage for a defrag.

Determining Free Space in an Exchange 2010 Mailbox Database

In Exchange 2010 you can see how big your mailbox databases are, and how much white space they have, by running the following command in the Exchange Management Shell.

[PS] C:\>Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace -auto

Name DatabaseSize AvailableNewMailboxSpace
---- ------------ ------------------------
MB-HO-01 18.26 GB (19,604,766,720 bytes) 9.544 GB (10,247,766,016 bytes)
MB-HO-02 15.63 GB (16,785,670,144 bytes) 3.696 GB (3,968,761,856 bytes)
MB-HO-Archive-01 648.1 MB (679,542,784 bytes) 134.6 MB (141,164,544 bytes)

In the example above the database MB-HO-01 is 18.26Gb in size but has 9.544Gb white space due to archiving that has occurred. If you want to reclaim that disk space then the file can be shrunk by using eseutil to defrag it.

In this example I will demonstrate how to defrag a mailbox database for a single Exchange 2010 Mailbox server that is not a member of a Database Availability Group.

Do not follow the procedure in this document if your Mailbox server is a member of a DAG. Before you defrag any mailbox database please read and understand the pros and cons of this operation and make the best decision for your specific situation.

Preparing to Defrag an Exchange 2010 Mailbox Database


The first thing to be aware of when planning a defrag is that you can only perform this task when the database is dismounted. This means that users with mailboxes on that database will not be able to access their email while you are defragging it.

The second thing to be aware of is that you need some available disk space to perform the defrag. This is because a new file is written during the defrag process, so for a period of time both the old and new files will exist, as well as a temporary file that eseutil creates.

So to plan for an Exchange 2010 mailbox database defrag you need an amount of free space equivalent to 1.1x the predicted size of the new file.

In this example that would be:


18.26 – 9.544 = 8.7

8.7 x 1.1 = 9.57


In other words, I’ll need about 10Gb of free disk space to run this defrag. Since I don’t have that much free space on the same drive as the database I will need to specify a different temporary location when I run eseutil. This can be another local drive or a UNC path, just be aware that if you are using a UNC path the defrag will take longer due to network latency.

Before proceeding you should be sure that you have a good, working backup that you can use for recovery if something goes wrong during the defrag.

Using ESEUtil to Defrag an Exchange 2010 Mailbox Database


Open the Exchange Management Shell and navigate to the folder containing the database file.

cd D:\Data\MB-HO-01

Dismount the mailbox database.

Dismount-Database MB-HO-01

No run ESEUtil to defrag the file.

[PS] D:\Data\MB-HO-01>eseutil /d MB-HO-01.edb /t\\testserver\defrag\temp.edb

Extensible Storage Engine Utilities for Microsoft(R) Exchange Server
Version 14.01
Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating DEFRAGMENTATION mode...
Database: MB-HO-01.edb

Defragmentation Status (% complete)

0 10 20 30 40 50 60 70 80 90 100
|----|----|----|----|----|----|----|----|----|----|
...................................................

Moving '\\testserver\defrag\temp.edb' to 'MB-HO-01.edb'...
File Copy Status (% complete)

0 10 20 30 40 50 60 70 80 90 100
|----|----|----|----|----|----|----|----|----|----|
...................................................

Note:
It is recommended that you immediately perform a full backup
of this database. If you restore a backup made before the
defragmentation, the database will be rolled back to the state
it was in at the time of that backup.

Operation completed successfully in 3788.218 seconds.

Mount the database again.

mount-Database MB-HO-01

You can now see that the file is smaller, and all the white space is gone.

Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace -auto

Name DatabaseSize AvailableNewMailboxSpace
---- ------------ ------------------------
MB-HO-01 8.328 GB (8,942,190,592 bytes) 5.219 MB (5,472,256 bytes)
MB-HO-02 15.63 GB (16,785,670,144 bytes) 3.696 GB (3,968,761,856 bytes)
MB-HO-Archive-01 648.1 MB (679,542,784 bytes) 134.6 MB (141,164,544 bytes)

As you saw when ESEUtil completed you should run a full backup of the database at your next backup window.

How to use Nslookup to verify MX record configuration

 

The example below shows how MX records appear for the fictitious domain, example.com.

C:\> nslookup

Default Server: pdc.corp.example.com

Address: 192.168.6.13

> server 172.31.01.01

Default Server: dns1.example.com

Address: 172.31.01.01

> set q=mx

> example.com.

Server: dns1.example.com

Address: 10.107.1.7

example.com MX preference = 10, mail exchanger = mail1.example.com

example.com MX preference = 10, mail exchanger = mail2.example.com

example.com MX preference = 10, mail exchanger = mail3.example.com

example.com MX preference = 10, mail exchanger = mail4.example.com

example.com MX preference = 10, mail exchanger = mail5.example.com

mail1.example.com internet address = 172.31.31.01

mail2.example.com internet address = 172.31.31.02

mail3.example.com internet address = 172.31.31.03

mail4.example.com internet address = 172.31.31.04

mail5.example.com internet address = 172.31.31.05

In this example, the preconfigured DNS server is behind a proxy server. Therefore, an external or Internet DNS server with a known IP address of 172.31.01.01 was used to perform the query. Next, the query type was set to MX to locate the mail exchangers for example.com. In this example, five SMTP servers are equally balanced, each with its own IP address. However, your domain might only have a single entry, as seen in the following example:

contoso.com MX preference = 10, mail exchanger = mailbox.contoso.com

mailbox.contoso.com internet address = 10.57.22.3

segunda-feira, 23 de novembro de 2015

Removing a Mailbox from Quarantine in Exchange Server 2013

 

n Exchange Server 2010 the process required more manual work (you can check the step by step http://itprocentral.com/releasing-a-mailbox-from-exchange-server-2010-quarantine/ ), however a new set of cmdlets *-MailboxQuarantine were introduced and they help the administrator to add and remove mailboxes in the quarantine.

A good way to check a list of all mailboxes that are being quarantined is using the following cmdlet:

Get-Mailbox –Server <Server-Name> –ResultSize unlimited | Get-MailboxStatistics | Where-Object { $_.IsQuarantined –eq $True } | Select DisplayName,IsQuarantined,QuarantineEnd

In order to remove a mailbox from there, just use the following the cmdlet:

Disable-MailboxQuarantine <mailbox>

 

http://itprocentral.com/removing-a-mailbox-from-quarantine-in-exchange-server-2013/

quinta-feira, 12 de novembro de 2015

10 must-have Windows server tools

 

http://www.techrepublic.com/blog/10-things/10-must-have-windows-server-tools/

How to Extend the Virtual Disk Size of a XenVM

This article contains the following procedures:
Extending the disk size in XenServer
Extending a partition size in Windows operating systems using the DiskPart utilityExtending a partition size in Linux operating systems

  • Shut down the corresponding VM.
  • Go to XenServer Command Line Interface (CLI).
  • Find Virtual Disk Image (VDI) Universally Unique Identifier (UUID) by running the following command:
  • # xe vm-disk-list vm=<vm name>
  • Run the following command to resize the VDI:
  • #xe vdi-resize uuid=<vdi uuid> size=GiB, MiB
  • Right Click My Computer and select Manage.
  • Select Disk Management and right click on the disk you want to extend and select Extend:
  • Launch a command prompt.
  • Type in diskpart and press Enter.
  • At the diskpart prompt, enter the following commands:
  • DISKPART>list volume
  • DISKPART>select volume # (For # enter the number of the volume you want to resize)
  • DISKPART>extend size=n (n is size in Megabytes that you are adding to the volume>
  • After you finish your work type exit to close DiskPart.
  • Type exit to exit the command prompt.
  • Click Restart. You might be asked to restart one more time once the operating system starts.
  • If you use ext3: After resizing the disk in XenServer, start the operating system and use the resize2fs tool with the name of the partition that should be extended (refer to the manual for more details). For example to resize a data partition:

  • #umount /dev/xvdc1
  • #fdisk /dev/xvdc1
  • #d (Delete the partition and recreate it)
  • #n (New partition)
  • #w (Write out table)
  • #e2fsck -f /dev/xvdc1
  • #resize2fs /dev/xvdc1
  • #mount /dev/xvdc1 /home
  • Shutdown the VM.

  • Set the VM to boot into single-user mode on the XenServer host CLI
  • #xe vm-param-set uuid=6f04... PV-args=single
  • Boot VM and show disk list make partition table changes in the Linux VM
  • #fdisk -l

  • fdisk /dev/xvda
  • d -Delete Partition
  • n -New create new partition
  • p -Primary
  • 1- Partition number
  • Default values for size
  • w -Write changes

  • reboot vm
  • Note: If you need to run FSCK, you must boot from rescue media.
  • Resize the filesystem:
  • resize2fs /dev/xvda1

  • On XenServer host:

  • Remove the single-user boot mode setting:
  • #xe vm-param-set uuid=6f04... PV-args=
  • If you use xfs: After resizing the disk in XenServer, start the operating system and use the xfs_growfs tool with the name of the partition that should be extended (refer to the manual for more details). For example:
  • # xfs_growfs /dev/xvda1
  • If you use reiserfs: After resizing the disk in XenServer, start the operating system and use the resize_reiserfs tool with the name of the partition that should be extended (refer to the manual for more details). For example:
  • # resize_reiserfs /dev/xvda1
  • How to extend the size of the disk in XenServer:

    With XenCenter 5.6, you can select the VDI from the Storage tab of the virtual machine click Properties, select Size and Location, then increase the size of the disk without using the command line.
    How to extend the partition size in Windows operating systems:
    These steps are also demonstrated in the video HowTo: Extend the Virtual Disk Size of a XenServer VM (Part 1 of 2).
    Using Disk Management:
    Note: This procedure works on Windows 2008 and Windows 7 for both data and system partitions. In Vista you can use this to extend a data partition only.




    This starts the Extend Volume Wizard. Follow the prompts to complete the process.
    Using the DiskPart utility:
      Refer to DiskPart Command-Line Options for more information.

      How to extend the partition size in Linux operating systems:
    These steps are also demonstrated in the video HowTo: Extend the Virtual Disk Size of a XenServer VM (Part 2 of 2).
    Linux operating systems supports many file system types (for example, ext3, xfs, reiserfs). To extend file systems on an extended disk you must use file system tools that correspond to a particular file system type. Recommended file systems are those that can be expanded while the system is running and mounted. For example:

      http://support.citrix.com/article/CTX125405