Team blog of MCS @ Middle East and Africa

This blog is created by Microsoft MEA HQ near shoring team, and it aims to share knowledge with the IT community.With its infrastructure and development sides,It brings to you the proven best practices and real world experiences from Subject Matter Experts
Follow Us On Twitter! Subscribe To Our Blog! Contact Us

November, 2012

  • Useful References - DPM 2010 for SharePoint

    As I was recently working on DPM 2010 for SharePoint I complied a list of references that can be used as a quick ramp-up for this product. Hope you will find it useful. DPM 2010 for SharePoint References DPM 2010 for SharePoint Storage Calculator...
  • Downsizing HMC Environment to Prepare for Exchange 2010 SP2 Hosted Solution – Part3

    As most of Hosted Messaging and Collaboration (HMC) companies start planning to migrate to Exchange 2010 SP2 hosted environment due to the change in strategy that was announced about the future of /hosting mode here, so most HMC customer have to move directly to Exchange 2010 SP2 in hosted mode as discussed here, and one of the activities come up to migrate from HMC to Exchange 2010 SP2 is Downsizing activity in the running HMC environment to utilize part of hardware to be reused in the new Exchange 2010 SP2 environment, and although it looks like a simple activity for some IT people but there are a lot of challenges that can be in some cases for some specific HMC components show stopper to continue the downsizing activity, in this post series I will share all my experience with HMC downsizing activity and explain how I deal with different challenges in this activity, in Part1 I covered the first step of HMC downsizing activity to select server roles that will be decommissioned, then covered most of preparations tasks in each of the selected roles, and in Part2 I went through the most critical step of preparing Mailboxes for decommissioning that include the bulk mailbox move script that move mailboxes by calling MPS, one of the important resource while working in this activity is Microsoft Provisioning System SDK that can be downloaded from here.

    In this post I will finalize this post series by finalizing 2nd Step of preparations and both 3rd Step for decommissioning activity itself and 4th Step which is post decommissioning activity.

    So let me start with final preparations steps as follow:

    • If you run <QueryAllStore.xml> and still find some organizations assigned to any mailstore, then you should troubleshoot and find if there is any object (OU, User, Mailbox) that was removed in Active Directory and still existing in MPS and this object still allocated to one of mailstore in MBX server that you target for decommission, to solve this issue which is not easy to resolve there are different scenarios as follows:
      • Scenario1: If object was deleted by accident, then perform Active Directory Authoritative Restore as described here, and this option used only if the object deleted accidently.
      • Scneario2: deleted object not needed any more, then perform Database cleanup and then recreate the user if needed, to clean up the database you will need to know the GUID of the deleted object and this data can be retrieve from MPS SQL “PlanManager” with select statement like <Use PlanManager SELECT * from Customers>, once you get the GUID then you will need to run “DeleteCustomerByGUID” xml request (using provtest.exe)  to clean the MPS database from this object using the GUID you got using the SQL query..
    • Then you need to move the recovered mailbox from MBX server that is target for restore, and then to run <QueryAllStore.xml> again.

    3rd Step: Now the environment should be ready for 3rd step which is the decommissioning or uninstall the selected server roles as listed in 1st step and it is recommended to do one more verification step before doing uninstall which is shutdown the target server role for certain amount of time and validate the the whole HMC solution still functional and provisioning still working without problems, then to uninstall role by role and give time between each one for testing and verify HMC environment functionality.

    4th Step: which is the post decommissioning activities, and in this step you should use all available tools to verify the HMC functionality and solve any discovered issues (you need to confirm that there is an active Microsoft Support for the HMC environment that can be used in case you face any issue while decommissioning), as sample of these tools you can use the following:

    • Exchange Best Practices Analyzer
    • Exchange Connectivity Analyzer
    • OCS Connectivity Analyzer
    • Do some provisioning activities through the available control panel
    • Event Viewer

    Hope that this post series can reducing the risk of downsizing activity and make it easier for consultant who will do the activity.

  • WCF Data Services 5.0 - Setup Failed (SharePoint 2013 Prerequisites)

    When trying to install WCF Data Services 5.0 prior to installing SharePoint 2013 setup failed with the error: "0x800b010a - a certificate chain could not be built to a trusted root authority". My test server is in a disconnected environment. I looked...
  • Downsizing HMC Environment to Prepare for Exchange 2010 SP2 Hosted Solution – Part2

    As most of Hosted Messaging and Collaboration (HMC) companies start planning to migrate to Exchange 2010 SP2 hosted environment due to the change in strategy that was announced about the future of /hosting mode here, so most HMC customer have to move directly to Exchange 2010 SP2 in hosted mode as discussed here, and one of the activities come up to migrate from HMC to Exchange 2010 SP2 is Downsizing activity in the running HMC environment to utilize part of hardware to be reused in the new Exchange 2010 SP2 environment, and although it looks like a simple activity for some IT people but there are a lot of challenges that can be in some cases for some specific HMC components show stopper to continue the down activity, one of the important resource while working in this activity is Microsoft
    Provisioning System SDK that can be downloaded from here.

    In this post series I will share all my experience with HMC downsizing activity and explain how I deal with different challenges in this activity, in Part1 I covered the first step of HMC downsizing activity to select server roles that will be decommissioned, then covered most of preparations tasks in each of the selected roles.

     

    In this post I will cover the preparations specific for Mailbox Role which is the most critical role of downsizing activity, and different preparations steps for Exchange MBX role can be divided as follows:

    • Validate that no Public folders in the selected MBX servers that are target for decommission or you will need to move public folder to another MBX server.
    • Verify which MBX server configured as Offline Address Book Server, OAB MBX server better to be excluded from MBX server list that are target for decommission or you have to move OAB from the target MBX server to another MBX server, to do this you can use “QueryAllServers.xml” that can be found under “Exchange 2007 OAB Resource Manager” folder, this query allow you to find which MBX Server configured as OAB Server
    • Verify which Business Organization (customers) allocated (in MPS Resource Manager) for which Exchange Mail Store, to do this verification you need to run “QueryOrganizationByMailstore.xml” that can be found under “Exchange 2007 Resource Manager” folder, new simple table can be created as below to list all Mailbox Servers, mailstores, and the allocated Organization per each mailstore, this table will be used in coming step after move mailboxes to verify that MBX servers that are target for decommission are not allocated for any organization any more (The good point is that you may find that some mailstores are empty and not allocated for any organization so you can easily delete these mailstores as per coming steps), you may need to stop provisioning new organization or new mailboxes at this stage to avoid creating new mailboxes on the mailstores that are target for decommission.

    Mail Server

    Mailstore

    Organizations before Mailbox Move

    After Mailbox Move

    MBX01

    MBX01-DB01

    Org1.com
    Org2.com
    Org3.Net

     

    MBX01-DB02

    MBX02

    MBX02-DB01

     

    MBX02-DB02

    • Move Mailboxes from any mailstore in any of MBX server that is target for decommissioning, this mailboxes move should be done through MPS using PowerShell script, I used script described here as a base for the script I used as below after doing some tuning, and simply the script is read from CSV file the list of mailboxes that will be moved and call MPS to de-allocate resources for the moved mailboxes from original MBX mailstore and allocate it to the new MBX mailstore, and I remember here my college <Kip Ng> who help me fixing and tuning the script, the script I used is as below (You should note that there are some steps listed in the begging of the script and should be followed as a preparation steps before running the script), as a sample of generated CSV that script use is as follow:

    PrimarySMTPAddress,TargetDB
    Maged
    @Org1.net,MBXV01\MBXV01SG01\MBXV01SG01DB01
    Kip
    @Org2.com,MBXV01\MBXV01SG01\MBXV01SG01DB01

    And the used script is below:

    # 1. Use the Exchange Management Shell to get the source server name with Get-ExchangeServer | Select Name     
    # 2. Use the Exchange Management Shell to populate the input CSV file with Get-MailboxDatabase | where {$_.ServerName.Contains("sourceservername") -eq "true"} | Get-Mailbox | Select PrimarySMTPAddress,Database | Export-Csv C:\Temp\MbxsToBeMoved.csv –NoTypeInformation     
    # 3. Change ‘Database’ field header to ‘TargetDB’     
    # 4. Modify database/targetdb field entries as required in the CSV    
    # 5. Change preferredDomainController in mailbox move script    
    # 6. Run mailbox move script:    
    # CSV Example:    
    # PrimarySMTPAddress,TargetDB    
    # bloggsj,mytargetservername
    $path = "C:\MailboxMove\MbxsToBeMoved.csv";
    Write-Host;
    Write-Host "*******************";
    Write-Host "Move Mailbox Script" -Foregroundcolor Blue -Backgroundcolor White;
    Write-Host "*******************";
    Write-Host;
    Write-Host "A CSV is required (i.e. $path)"
    $Ver1 = Read-Host "CONTINUE script execution? [Y] to continue or [ANY OTHER KEY] to exit"
      if ($Ver1 -ne "Y")
      {exit;
      }
    Write-Host;
    Write-Host "Valid entries in CSV:" -Foregroundcolor Blue -Backgroundcolor White;
    Write-Host;
    Write-Host "PrimarySMTPAddress,TargetDB";
    Import-csv -path $path |
    foreach `
    {
                   $TDBs = Get-MailboxDatabase $_.TargetDB -ErrorVariable MyError -ErrorAction SilentlyContinue;
        $A = $_.PrimarySMTPAddress
                   Write-Host "$A,$TDBS";
    }
    If ($MyError -ne $null)`
    {
                   Write-Host;
        Write-Host "*******";
                   Write-Host "Error" -Foregroundcolor Red -Backgroundcolor White;
        Write-Host "*******";
        Write-Host "Invalid TargetDB in CSV. Script terminating..." -Foregroundcolor Blue -Backgroundcolor White;
        Write-Host "Error Description:" -Foregroundcolor Blue -Backgroundcolor White;
        $MyError;
        Write-Host;
                   exit;
    }
    $Ver2 = Read-Host "CONTINUE moving ALL mailboxes in CSV? [Y] to continue or [ANY OTHER KEY] to exit"
      if ($Ver2 -ne "Y")
      {exit;
      }
    Function SendMPSRequest([string]$xmlRequestStr)
    {
      $oMpf = new-object -comobject "Provisioning.ProvEngineClient"
      $xmlResponseStr = $oMPF.SubmitTrustedRequest($xmlRequest.get_InnerXml());
      $xmlResponse = new-object "System.Xml.XmlDocument";
      $xmlResponse.LoadXml($xmlResponseStr);
      $xmlResponse;
    }
    [string]$xmlRequestStr = @"
    <?xml version="1.0" encoding="utf-8"?>
    <request>
      <data>
        <preferredDomainController>ad01.HMC.Local</preferredDomainController>
        <user>CSVPopulated</user>
        <targetDatabase>CSVPopulated</targetDatabase>
      </data>
      <procedure>
        <execute namespace="Hosted Email 2007" procedure="MoveMailbox" impersonate="1">
          <before source="data" destination="executeData" mode="merge" />
          <after source="executeData" destination="data" mode="merge" />
        </execute>
      </procedure>
    </request>
    "@
    [string]$excXmlStr = @"
    <?xml version="1.0" encoding="utf-8"?>
    "@
    Write-Host
    Write-Host "Starting procedure..." -Foregroundcolor Blue -Backgroundcolor White;
    Write-Host
    $CSV = Import-csv -path $path
    Foreach ($line in $CSV)`
      {
        $mailbox = Get-Mailbox $line.PrimarySMTPAddress | Select PrimarySMTPAddress, DistinguishedName;
    Write-Host $line.PrimarySMTPAddress
    Write-Host $mailbox
        $userName = $mailbox.SameAccountName;
        $userDN = $mailbox.DistinguishedName;
        $TDB = $line.TargetDB
        Write-Host "Moving $userName to $TDB..." -ForegroundColor White
        Write-Host
        $xmlRequest = new-object "System.Xml.XmlDocument";
        $xmlRequest.LoadXml($xmlRequestStr); 
        $xmlRequest.request.data.user = "LDAP://" + $userDN;

    Write-Host $userDN;

        $xmlRequest.request.data.targetDatabase = $TDB;
        $xmlResponse = $null;
        $xmlResponse = SendMPSRequest($xmlRequestStr.ToString());
            if ($xmlResponse.Response.Data.User -ne $null)`
            {
                $MPSUser = New-Object System.Object;
                $MPSUser | Add-Member -Type NoteProperty -Name "DistinguishedName" -Value $userDN;
                $MPSUser | Add-Member -Type NoteProperty -Name "User" -Value $xmlResponse.Response.Data.user;
                $MPSUser | Add-Member -Type NoteProperty -Name "TargetDB" -Value $xmlResponse.Response.Data.targetDatabase;
                $MPSUser | FL;
            }
      }           
    Write-Host;
    Write-Host "********************************************************************************************************************************************************************************************";
    Write-Host "Script execution complete. In pre-HMC4.0 Hosted Exchange Update Rollup 5 environments, please remember to run the Managed Email 2007::RepairExchangeObject procedure on all mailboxes moved." -Foregroundcolor Blue -Backgroundcolor White;
    Write-Host "********************************************************************************************************************************************************************************************";
    Write-Host;

    • After successfully move all Mailboxes from target MBX Server/s to different MBX Server/s then you need to run step 3 again and complete the last column to be sure that mailstores in target MBX Servers are empty and not assigned for any organization.
    • Now you can remove the empty mailstores (after moving mailboxes and verifying that these mailstores are not allocated for any organization), this by running “RemoveExchangeResource.xml” under “Exchange Resource Manager” folder in MPS Engine Server.
    • Then you can run “QueryAllStore.xml” to verify that all mailstores in target MBX server/s were removed from MPS Resource Manager.
  • Downsizing HMC Environment to Prepare for Exchange 2010 SP2 Hosted Solution – Part1

     As most of Hosted Messaging and Collaboration (HMC) companies start planning to migrate to Exchange 2010 SP2 hosted environment due to the change in strategy that was announced about the future of /hosting mode here, so most HMC customer have to move directly to Exchange 2010 SP2 in hosted mode as discussed here, and one of the activities come up to migrate from HMC to Exchange 2010 SP2 is Downsizing activity in the running HMC environment to utilize part of hardware to be reused in the new Exchange 2010 SP2 environment, and although it looks like a simple activity for some IT people but there are a lot of challenges that can be in some cases for some specific HMC components show stopper to continue the downsizing activity, one of the important resource while working in this activity is Microsoft
    Provisioning System SDK that can be downloaded from here.

    In this post series I will share all my experience with HMC downsizing activity and explain how I deal with different challenges I found in downsizing HMC.

    • First step of this activity is to carefully plan for the whole downsizing activity and to chose which HMC components that will be decommissioned from the running HMC solution without affect the whole HMC solution functionality, considering the current load and utilization of each role, below is different selected roles and the reason behind the selection:
      • Exchange Edge Servers – consider keeping minimum 2 Exchange Edge Servers for load balancing and keep Exchange Edge high available
      • OCS Edge Servers - consider keeping minimum 2 Edge Servers for load balancing and keep OCS Edge high available
      • TMG Servers - consider keeping minimum 2 TMG Servers for load balancing and keep TMG high available
      • Exchange Hub Servers - consider keeping minimum 2 Exchange Hub Servers for load balancing and keep Exchange Hub high available
      • Exchange CAS Servers - consider keeping minimum 2 Exchange CAS Servers for load balancing and keep Exchange CAS high available
      • OCS Archive and Monitoring Server – consider that you are going to lost OCS Archiving feature which is optional in HMC environment, if not then you should keep it.
      • OCS Front End Servers - consider keeping minimum 2 OCS Front End Servers for load balancing and keep OCS Front End high available
      • OCS Web Access Servers - consider keeping minimum 2 OCS Web Access Servers for load balancing and keep OCS Web Access high available
      • Provisioning Front End Servers - consider keeping minimum 2 Provisioning Front End Servers for load balancing and keep Provisioning Front End high available
      • Active Directory Domain Controllers - consider keeping minimum 2 Domain Controllers for load balancing and keep Directory Service high available
      • Exchange Mailbox Servers – Considering keeping minimum 2 Exchange MBX Servers for in Cluster (2 CCR nodes or 2 Active/Passive SCC nodes) and keep Exchange MBX high available, and this is the most critical components in downsizing activity because of Microsoft Provisioning System (MPS) Resource Manager dependencies on Exchange MBX resources.
    • Second step is the preparation for decommission of each server role, and preparations is something that should be done for each role target for decommission as following:
      • Exchange Edge Servers – for Exchange Edge decommissioning you will need to remove edge servers that are target for decommission from Edge Subscription from Exchange Hub as described here, then to delete Edge subscription form each Edge Server that will be decommissioned as described here, this beside the important step to remove the decommissioned Exchange Edge Server from the list of Edge Servers in Load Balancer (Load Balancer may need to be refreshed and disconnect all current sessions) or in External DNS.
      • OCS Edge Servers – for OCS Edge decommissioning simply you will need to remove OCS Edge from Load Balancer (Load Balancer may need to be refreshed and disconnect all current sessions), and update OCS configuration from OCS front end by removing the decommissioned OCS Edge Server.
      • TMG Servers – for TMG you should take care about removing TMG Servers that are target for decommission from the existing TMG array and to remove the decommissioned TMG Servers from any computers sets and/or access rules.
      • Exchange Hub Servers – for Exchange Hub you should consider removing Exchange Hub Server that are target for decommission from Load Balancer (if any Load Balancing configuration done for internal application SMTP relay), and to update all Send and Receive Connectors to not include these Exchange Hub Servers.
      • Exchange CAS Servers– for Exchange CAS you should consider removing Exchange CAS Servers that are target for decommission from computer sets in TMG configuration, then to remove it from Load Balancer (Load Balancer may need to be refreshed and disconnect all current sessions), then you need to remove CAS Servers that are target for decommission from Offline Address Book Servers list that were added by “AddOABCAS.xml” [<installdir>:\Program Files\Microsoft Hosting\Provisioning\Samples\Managed Email 2007] from MPS using the following procedure:

        1. Use GetOABCASPoolDefault.xml to get the CAS Pool Name

        2. Use Get OABCAS.xml to know which CAS servers are member in CAS Pool for OAB

        3. Use DeleteOABCAS.xml to delete CAS that will be decommissioned

        And one of the best practices for CAS decommissioning in HMC environment is to shutdown CAS Servers that will be decommissioned for a certain time and check that everything in the HMC environment is working good

      • OCS Archive and Monitoring Server – for OCS Archive and/or Monitoring Server all you should take care about is to uncheck the option to Enable Archive and/or Enable monitoring from OCS Front End Server
      • OCS Front End Servers – for OCS Front End Servers you need to remove all Front End Servers that are target for decommission from Load Balancer, and update OCS configuration to not include the decommissioned OCS Front End Servers in list of Front End Servers from OCS Front End and from OCS Edge Servers
      • OCS Web Access Servers - for OCS Web Access Servers you need to remove all Web Access Servers that are target for decommission from Load Balancer, and to deactivate Web Access Server follow Microsoft Documentation here 
      • Provisioning Front End Servers – for provisioning front end servers decommissioning, you should consider removing front end servers that are target for decommission from load balancer
      • Active Directory Domain Controllers – for Active Directory Domain Controllers it is very important to move FSMO roles from all Domain Controllers that are target for decommission, also to remove these Domain Controllers from list or preferred Domain Controllers in Control Panel (If this was configured in Control Panel) 
      • Exchange Mailbox Servers -  for Exchange Mailbox Servers decommissioning a lot of preparations should be done carefully, this will include steps to update the MPS resource manager before moving or deleting any objects considering Moving Mailboxes using script that should de-allocate Organization assignment from each Mailbox Store then allocate the Organization assignment to the target Mailbox Store then to move the Mailbox to different Mailbox Store I will share the correct script to be used for this critical step, and this will be discussed later in different post of this post series.
    • Third step is the decommissioning activities itself specially, and this will be discussed later in different post of this post series.
    • Fourth and last step is the post decommissioning activities, and this will be discussed later in different post of this post series.

     

    In the next post I will continue with the decommissioning preparation activities related to MBX server role and MPS activity related to it, followed by 3rd and 4th steps for downsizing activity, this will be coming soon be tuned.