Tuesday, 5 November 2013

Calculating CAL requirements for Exchange Server 2013

Today I had a request from finance to calculate our Standard and Enterprise CALs for Exchange 2013. We have historically relied on exART data but as Exchange 2010 has this feature in the EMC and via Powershell, I knew Exchange 2013 likely would have also.


Things have changed since Exchange 2010 however. Two Powershell commands are available. Get-ExchangeServerAccessLicense reports on the licenses available to be reported on. Get-ExchangeServerAccessLicenseUser will total up the CALs required for different scenarios. I am specifically looking for Standard CAL and Enterprise CAL usage so these two Powershell commands should give me what I need.

Get-ExchangeServerAccessLicenseUser –LicenseName "Exchange Server 2013 Standard CAL"
Get-ExchangeServerAccessLicenseUser –LicenseName "Exchange Server 2013 Enterprise CAL"


They both work, but what I found was that ZERO Enterprise CALs came back continually. I knew this couldn't be the case as we have both Unified Messaging and in-place Archives enabled, and Microsoft licensing states these are Enterprise CAL features: http://office.microsoft.com/en-gb/exchange/microsoft-exchange-server-licensing-licensing-overview-FX103746915.aspx

So what was up?

Digging into Powershell I confirmed the numbers for UM:



Just in case it was a UM specific issue, I tried it against in-place Archive, and again I got hits so it appears there's an apparent Enterprise CAL calculation issue in the code.



Back in Exchange 2010 there were two great TechNet scripts for Exchange 2010 and Exchange 2010 SP1+ You can see them here:


Unfortunately they don't work (I immediately tried the SP1 version):


The above was the first of many errors. So I have gone through the code and cleaned up what isn't supported anymore like you see above, Managed Folder Policies; and also changed all cmdlets that have changed since Exchange 2010 SP3 to Exchange 2013 as well as tidy up a few other bits and pieces and remove any old Enterprise CAL features that are now support via the Standard CAL.

Currently Data Loss Prevention is a manual check, as I wanted to get this out of the door today and we don't use that feature here, but by all means add it into the code and let me know!

This is how it looks, working, against Exchange 2013 today:


You can grab the updated ReportExchangeCALS.ps1 script now for Exchange 2013, here.

Enjoy.

Update: Jeff Guillet (follow him on Twitter @expta) has also pointed out that the Exchange 2013 Help File (chm) has incorrect information for these licensing Powershell commands, so don't reference them!

Take care,

Oliver Moazzezi - MVP Exchange Server



11 comments:

Marc Barash said...

I installed a VM Server 2012 R2 Essentials with 25 users and a VM Server 2012 R2 with Exchange 2013. Upon Exchange installation, 9 new users appeared in Essentials which threw us over the 25 user limit and a critical message that we have exceeded our user limit. The users added by exchange are as follows: (3) Healthmailboxs, (2) Microsoft Exchange, (1) ME Approval Assistant, (1) ME Federation Mailbox (1) ME Migration, (1) MSExchDiscoveryMB and (1)$IJ3000-GBOMN031S5OI. Can I reduce these to a more manageable number and release my user licenses in Essentials?

Martin Kaufmann said...

Maybe this wasn't possible @ nov'13.

Now you can get it with this two:
Get-ExchangeServerAccessLicenseUser -LicenseName ((Get-ExchangeServerAccessLicense | ? {$_.UnitLabel -eq "CAL"}).licenseName)[0] | measure | select Count
Get-ExchangeServerAccessLicenseUser -LicenseName ((Get-ExchangeServerAccessLicense | ? {$_.UnitLabel -eq "CAL"}).licenseName)[1] | measure | select Count

or if you are not sure with one is the standard/enterprise, just make another filter like this;

Standard CALs:
Get-ExchangeServerAccessLicenseUser -LicenseName (Get-ExchangeServerAccessLicense | ? {($_.UnitLabel -eq "CAL") -and ($_.LicenseName -like "*Standard*")}).licenseName | measure | select Count

Enterprise CALs:
Get-ExchangeServerAccessLicenseUser -LicenseName (Get-ExchangeServerAccessLicense | ? {($_.UnitLabel -eq "CAL") -and ($_.LicenseName -like "*Enterprise*")}).licenseName | measure | select Count

Oliver Moazzezi said...

Hi Marc,

You should leave those, I am surprised it is picking those up as user licenses. You may want to raise a case to PSS as it shouldn't be counting them if adding Exchange 2013 to a Essentials deployment is supported.

Oliver Moazzezi said...

Hi Martin,

Cool i'll check that out.

Kalai said...

Hi
I tried to run the script on exchange 2010 sp3 but getting below error as ReportExchangeCALs.ps1 Index operation failed; the array index evaluated to null Kindly help to fix this

Oliver Moazzezi said...

Hi Kalai,

Use the Exchange 2010 SP1 script here

http://gallery.technet.microsoft.com/68321b75-ab3d-4e04-9fe1-6a42de23b67f#content

Kalai said...

I tried to run the script again from the url https://gallery.technet.microsoft.com/68321b75-ab3d-4e04-9fe1-6a42de23b67f#content but its getting failed with the error code as Index operation failed; the array index evaluated to null.

Oliver Moazzezi said...

Kalai

Are you running the TechNet gallery script against Exchange 2013? It won't work. Use my one.

Jason Spreen said...

This script works great, but i can't figure out how to get the output into a file. When I try, it creates a 0 byte file that is blank. How can I export this info?

Oliver Moazzezi said...

What command are you typing?

Jason Spreen said...

I have tried .\ReportExchangeCALs.ps1 >> c:\test_file.txt
.\ReportExchangeCALs.ps1 | out-file c:\test_file.txt and both output blank files.

When I run the .\ReportExchangeCALs.ps1 file by itself, it works great, but only displays the results in the powershell command window. I would like to output the license counts to a text file so I can automate monthly reports for my customers. Any ideas?