Modifying vSphere VM Hardware – Checklist

Just a quick post to remind myself of the gotchas when you do some routine maintenance on VMs in vSphere.

Disks

  1. Make sure the underlying datastore has capacity! An obvious one but probably the most important.
  2. Before ESXi 6.5 you couldn’t extend a VM online past 2TB, it has to be shut down and then extended. Link
  3. Don’t forget about the partition types, Windows MBR only supports up to 2TB if you want to go past that you need to format (and lose all data) then convert to GPT.
  4. If you are running VMware SRM (Site Recovery Manager) then you can’t edit a protected VM, you may need to stop the replication (unprotect the VM) make your adjustments then enable replication again which if it’s a large VM or slow network can take a significant amount of time and may require out of hours scheduling.

 

CPU

  1. Hot Add CPU is a great feature however NUMA isn’t supported with hot add, it’s a convenience vs performance argument. Link
  2. More isn’t always better, generally the less CPUs the better. Link
  3. Be careful with OS and/or application licensing, some apps are licensed per CPU so make sure to check beforehand.

 

RAM

  1. If you increase the amount of virtual RAM don’t forget that the swap file on the datastore will also grow equal to the size of the vRAM, which if you’re increasing a VM or multiple VMs at once can fill a datastore.

 

Final thoughts, hopefully these tasks are automated but good to remember it’s not just the VMware environment that you are working on.

  1. Update any monitoring tools if required to ensure the counters are accurate
  2. Update your CMDB to reflect the changes
  3. Update any design/build documentation if required

Wildcard searches in Exchange message tracking

Unfortunately when using the GUI for message tracking there is no way to use wildcards, say for instance you want to find an email from an entire domain but you don’t have the senders email address you can’t search for *@microsoft.com however using PowerShell you can use wildcards as shown below.

 

Get-MessageTrackingLog -ResultSize Unlimited -Start “3/28/2013 8:00:00 AM” -End “3/29/2013 8:00:00 AM” | where{$_.sender -like “*@microsoft.com”} | select-object Timestamp,SourceContext,Source,EventId,Recipients,MessageSubject,{$_.Sender} |FT

 

The above example will search between 8am on the 28th of March until 8am on the 29th of March for any email with from any email address with the domain microsoft.com any variant can be used, for example if you need to find a certain email but don’t know the entire subject line the same code can be used the only difference is that the statement

where{$_.sender -like “*@microsoft.com”} 

would change to 

where{$_.subject -like “*important subject line*”}

The output also needs to change so make sure that the below statement is also changed from

{$_.Sender}

to

{$_.Subject}

 

From there you can pipe the output to CSV and work with the data in Excel as needed. Have fun!

 

 

 

 

Exmon Error – Exchange is not running on this computer.

So I’m trying to run Exmon this morning on a client site, if you’re not sure what Exmon is it is a great Microsoft tool for seeing what type of client as well as who is connecting to your Exchange server, read more here.

http://www.msexchange.org/articles-tutorials/exchange-server-2003/tools/Microsoft-Exchange-Server-User-Monitor.html

The issue I came across was that Exmon wouldn’t run as “Exchange wasn’t running on the specific server” (error shown below) which was a little worrying given it is an Exchange server 🙂 after some googling I realised that UAC was enabled and was blocking Exmon, right clicking the EXE and selecting Run As Administrator fixed the issue, given the error message isn’t very descriptive I thought I better make a note of it!

exmon issue

vCenter Converter Performance Issues

I’ve been doing some P2V’s for a client recently and have been really struggling with performance, after checking over the hardware aspect I did some googling and came across the below article.

Whilst the ability to encrypt the data is a nice feature as long as the P2V is happening over a secure network there shouldn’t be a huge risk in transferring the data un-encrypted and the performance gain is well worth it in my opinion.

Converter uses NFC (a proprietary VMware protocol) for cloning to managed destination. Security has been enhanced in Converter 5.0 by encrypting the data transfer. Unfortunately this has caused a more severe performance degradation than expected. 
Switching off SSL encryption is a way to work around this issue. Here is how it is done:

  1. Open the converter-worker.xml configuration file. It is located in “%ALLUSERSPROFILE%\VMware\VMware vCenter Converter Standalone” folder for Windows Vista or newer or in “%ALLUSERSPROFILE%\Application Data\VMware\VMware vCenter Converter Standalone” for older Windows versions.
  2. Set the key Config/nfc/useSsl to false and save the configuration file.
  3. Restart “VMware vCenter Converter Standalone Worker” service.”

http://communities.vmware.com/message/1866091

Forcing/Manually Generating Offline Address Book on Exchange 2007/2010

Whilst you shouldn’t need to force an update of the OAB if you’re in a hurry run through the below steps.

Login to the mailbox server hosting the OAB and run the below command

Update-OfflineAddressBook “Offline Address List” – If you’re unsure of the name of your OAB run Get-OfflineAddressBook |FL (this will also show you where it is being hosted)

Wait a few minutes then check the Application event logs, there should be an event regarding OAB updates, if it was successful then run.

Update-FileDistributionService -Identity “CASServer” -Type “OAB”

This should be run on every CAS server however as it will happen automatically anyway if it’s only one site that needs the update immediately you could just specify that CAS server. Otherwise run the below command to force all CAS servers to download the updates.

Get-ClientAccessServer | Update-FileDistributionService -type “OAB”

Please note, even once this has been completed successfully Outlook still won’t have the new OAB as it will need to be downloaded manually (by default Outlook will download the OAB once a day or on start-up)

http://office.microsoft.com/en-us/outlook-help/download-the-offline-address-book-HA010153532.aspx

http://support.microsoft.com/kb/841273

One way around all this is to check out the below post

http://www.howexchangeworks.com/2011/09/finding-new-user-in-gal-while-in.html

Where’s my database gone!?

 

I needed to reboot a server tonight and thought I should double check that the databases had mounted so I ran the below command

Get-MailboxDatabase |FL name,*mounted*

Name : DAG1
MountedOnServer :
Mounted :

Much to my horror the results showed that the database wasn’t mounted! After checking the EMC the database was in fact mounted and after some googling I found that I had forgotten the -Status cmdlet

Get-MailboxDatabase -Status |FL name,*mounted*

Name : DAG1
MountedOnServer : EXC01.****.com
Mounted : True

Just a FYI there’s no need to update the resume just yet, check your script first 🙂

Active Directory is rebuilding indices after reboot of DC

I just finished decommissioning a Server 2003 DC/DNS/Exchange2003 server for a client and once Exchange 2003 had been uninstalled the server needed a reboot, during the startup the above message came up which scared the living daylights out of me!

I found the below article which is a life saver, turns out that in my case I had the Exchange 2003 ISO still attached in VMware which was causing issues, I dismounted it and the server is now booting without issue.

http://www.neomagick.net/zen/2008/01/24/active-directory-is-rebuilding-indices-dont-panic-it-may-be-easier-than-it-sounds/

Copy/Paste Send or Receive Connectors Exchange 2010

Recently I needed to set up a new receive connector at a remote site that was internet facing so that mail was only accepted from a hosted spam filter, the list of IPs that needed to be added was already configured on another Receive connector at another site so I did a bit of googling and found this powershell command.

Set-ReceiveConnector “SERVER2\ReceiveConnector” -RemoteIPRanges ( Get-ReceiveConnector “SERVER1\ReceiveConnector” ).RemoteIPRanges

In this example I had already created the Receive Connector as I was going to add them manually but then decided against it, however if you wanted to start from scratch you could just as easily use New-ReceiveConnector with the correct switches and this will still work.

Server1 = Old server from which you plan to copy the IPs from
Server2 = The new server which you will be editing

To verify that the copy worked run the below command and you should see all the IPs in your new ReceiveConnector!
Get-ReceiveConnector “SERVER2\ReceiveConnector” |fl remoteipranges

*As a side note, I noticed when I ran the above command it would only list a few of the remoteipranges before trailing off, if you want to see all the data run the below command

(Get-ReceiveConnector SERVER2\ReceiveConnector).remoteipranges > C:\Server2-ReceiveConnector.txt

It will create a text file on your C: drive named Server2-ReceiveConnector.txt the output isn’t pretty but at least it’s all there.

One last thing, whilst I’ve only talked about Receive Connectors this will apply to Send connectors, you could also modify the script to work with any value that you wanted to copy or manipulate.

How to export a mailbox’s folder structure in Exchange 2010

I found this brilliant post today

http://www.myexchangeworld.com/2010/08/how-to-export-a-mailboxs-folder-structure-in-exchange-2010/

Basically it will show a listing of a particular users mailbox, which is very handy if they have several hundred folders and accidentally drag and drop a folder from one to another and then can’t find it.

I ran the query on the exchange server then used the find option, found the folder and moved it back to where it belonged. No need to run a restore job or go hunting manually for the folder 🙂

get-mailboxfolderstatistics –identity "mailboxname" |% {$_.identity.tostring().split("\")[1..100] -join "\"}

 

Migrating user from Exchange 2003 to 2010 SP1 creates shared mailbox instead of user mailbox

Each night I’ve been migrating a handful of users for a client from Exchange 2003 to 2010 SP1 without issue however when I logged on this morning I noticed a few accounts were labeled as Shared Mailboxes not User Mailboxes in the EMC.

Whilst I’m not sure why this happened as I used the EMC to move them the same as everybody else I did find it’s quite simply to change the mailbox back to a User Mailbox by using the EMS

Set-Mailbox <username> -Type Regular

If you had several users you could find all Shared mailboxes then convert them to Regular however this is going to change ALL shared mailboxes not just the ones recently converted.

Get-Mailbox -Type “SharedMailbox” | Set-Mailbox -Type Regular

I did the first command in a production system during business hours and the user had no issues however as always test first or try it on someone you don’t particularly like 🙂