Tuesday, February 10, 2015

How to count the number of DC's in your forest and individual domains with PowerShell

For some reason, with all the power of the internets, this answer was nowhere to be easily found.

I needed to be able to count the number of (Domain Controllers) DC's in our forest, and also for a specific domain. It's a simple PowerShell script ... here is what I used


$domains = (Get-ADForest).Domains;

foreach ($domain in $domains)


    Write-Host $domain
    (Get-ADDomain -Identity $domain | select -ExpandProperty ReplicaDirectoryServers).Count;
    Write-Host "";
    $totalCount = $totalCount + (Get-ADDomain -Identity $domain | select -ExpandProperty ReplicaDirectoryServers).Count;

Write-Host "Total domain controller count is: "$totalCount

Friday, January 16, 2015

5 Tips for Exchange Server 2013 Administrators

Are you thinking about deploying Exchange Server 2103 or have you already done it? Microsoft released the Exchange Server 2103 Preview  in July 2012 and the Release to Manufacturing (RTM) build for Exchange Server 2013 in October 2012. Exchange Server 2013 is now up to cumulative Update(CU) 7 released in December 2014.  In this new blog series, we will be sharing some helpful tips that will help you as an Exchange 2013 Administrator.

5 Tips for Exchange Server 2013 Administrators
  1. Learn PowerShell and the Exchange Management Shell.
  2. PowerShell (formerly Monad), a management framework that combines a command line shell with a scripting language. PowerShell has been around since 2006 and is currently up to version 5. Exchange Management Shell (EMS) is an extensible command line interface for Exchange Server Management that sits on top of PowerShell. Learning how to use PowerShell and EMS are important to our jobs as Exchange Server 2013 Administrators. Unlike in Microsoft Exchange Server 2007, where local Windows PowerShell is used, a Windows PowerShell snap-in for Exchange isn't loaded for Exchange 2013. PowerShell connects to the closest Exchange 2013 server using a required component called Windows Remote Management 3.0, performs authentication checks, and then creates a remote session for you to use. There are plenty of resources available online for you to learn more about PowerShell.

  3. Know the hardware Exchange Server 2013 is deployed on.
  4. If you are deploying Exchange Server 2013 at your location on purchased servers, you need to evaluate the following: Memory, CPU and disk space. You will need to purchase Client Access Servers and Mailbox servers. Investing in an Uninterruptible Power Supply (UPS) is highly recommended to allow you to properly shutdown the Exchange servers in case of a power outage.  If you are going with  Exchange Online and Office 365, the data center provides the hardware and will have the ability to scale out and scale up as needed. They will also have UPS for the servers in the data center.

  5. Review and Use the new Exchange Server Role Requirements Calculator(formerly Exchange Storage Calculator)
  6. This tool from Microsoft is essential in giving us recommendations for:
    • Deploying dedicated server roles, the minimum number of Client Access Processor Cores, minimum number of Client Access Servers and memory in each server.
    • Deploying Multi-role servers(Client Access and Mailbox) The Client Access Role will be accounted for in the memory and CPU recommendations.
    New to the tool is transport sizing and database sizing and better utilization of disks for Just a Bunch of Disks (JBOD) scenarios for Exchange 2013 installations. The calculator will recommend multiple databases in each volume and supports single datacenter deployments and multi-datacenter deployments like ours.
    Download the latest version of the Exchange 2103 Server Role Requirements Calculator here.

  7. Have a test lab for your Exchange Server 2013 Environment
  8. This is a critical step in preparation for deploying any version of Exchange Server. Before you begin you should review the Exchange 2013 Prerequisites.  For an Exchange Server 2013 test lab environment, we would suggest domain controller(s), a root Certification Authority (CA) Server, DNS and DHCP Servers, Exchange Server 2013 Mailbox and Client Access Servers and workstations for client testing running Office 2010, 2013 or 2016 depending on what is being used in your environment.

  9. Learn how Role Based Access Control (RBAC) works
  10. RBAC is the permission model used in Exchange Server to control what Administrators and users can do based on their roles within your company. Microsoft references the Triangle of Power that addresses The Where, The What and The Who. The Where is where will the permissions be needed. This is also known as the scope. The What is what the person needs to be able to do within The Where. These can be customized to meet your company needs. This is also known as the Role. Finally The Who is the person(s) (administrator or user) that needs to be able to do The What in The Where they have been allowed to do it. This is known as a role group. Finally the Glue or Role Assignment is how all the parts work together. For more information reference "Understanding Role Based Access Control".

We have just published 5 more tips for Exchange Server 2013 Administrators called "5 More Tips for Exchange Server 2013 Administrators" If you have any thoughts, opinions or comments feel free to share them below.