Showing posts with label Exchange 2010. Show all posts
Showing posts with label Exchange 2010. Show all posts

February 6, 2017

With the widespread usage of devices such as iPhones and Androids in the business world, it pretty much goes without saying that E-Mail access is literally at everyone's fingertips. For an IT Professional, this can turn into a nightmare to manage as everyone with an E-Mail address will want E-Mail onto their mobile device, whether it be a company-provided device or a personal one. By default, Microsoft Exchange makes it trivial for a user with an E-Mail account to configure it onto their mobile device without needing assistance from IT. Even if you are a business that doesn't allow employees to use their own mobile devices for business-related work, you still cannot prevent them from adding corporate E-Mail onto their own device by default in Microsoft Exchange.

Thankfully, Microsoft provides an ActiveSync Quarantine feature that can be enabled that will allow you to manage all new ActiveSync connections within your Microsoft Exchange server. With this enabled, any new devices that are configured for E-Mail access will be quarantined until an administrator approves the device. Both the employee who is attempting to add E-Mail to their device, and the administrator will receive a notification of this.

In order to first verify that you do not currently have this feature enabled, you can run the following PowerShell command from within the Exchange Management Shell.

Get-ActiveSyncOrganizationSettings

If you do not currently have this feature enabled, then you should see the following for DefaultAccessLevel, UserMailInsert, and AdminMailRecipients.


Once it has been confirmed that this feature doesn't happen to already be enabled, we will need to run a script that will pre-approve all devices that are currently syncing with Microsoft Exchange. Were you to move forward with enabling the Exchange ActiveSync Quarantine without first doing this step, you would end up quarantining every single mobile device that is currently connected to your Exchange server. Chances are, this could end up fairly chaotic, as you probably have more than just a handful of employees with E-Mail on their mobile device. In order to pre-approve all existing devices, we can run a script that will determine the DeviceIDs for each device connected to every employee's E-Mail account, and then add those DeviceIDs to the ActiveSyncAllowedDeviceIDs object on each mailbox.

The script is as follows, and should be ran from the Exchange Management Shell:

# Retrieve mailboxes of users who have a connected ActiveSync Device
$CASMailboxes = Get-CASMailbox -Filter {hasactivesyncdevicepartnership -eq $true -and -not displayname -like "CAS_{*"} -ResultSize Unlimited;
# Approve each device
foreach ($CASMailbox in $CASMailboxes)
{
# Array to store devices 
$DeviceIDs = @();
# Retrieve the ActiveSync Device Statistics for the associated user mailbox 
[array]$ActiveSyncDeviceStatistics = Get-ActiveSyncDeviceStatistics -Mailbox $CASMailbox.Identity;
# Use the information retrieved above to store information one by one about each ActiveSync Device
foreach ($Device in $ActiveSyncDeviceStatistics)
{
$DeviceIDs += $Device.DeviceID
}
Set-CasMailbox $CASMailbox.Identity -ActiveSyncAllowedDeviceIDs $DeviceIDs
} 

After running this script, you can verify if it was successful by running the following PowerShell command against one of your employee mailboxes.

Get-CASMailbox -Identity mail@domain.com | fl *ActiveSync*

If they had a mobile device connected to Exchange, then its corresponding DeviceID should now be within the ActiveSyncAllowedDeviceIDs object. The images below show the output of this command before running the pre-approval script, and afterwards.

Before ActiveSync DeviceID approval.

After ActiveSync DeviceID approval. This employee has one device approved.

Now that all of the currently connected devices have been added to the ActiveSyncAllowedDeviceIDs object on each mailbox, you can move forward with enabling the ActiveSync Quarantine. In order to do this, you will need to determine what E-Mail address will be setup to receive the quarantine messages whenever a device has E-Mail configured onto it. It is recommended to use something like a Distribution Group, so that multiple individuals within your IT department will receive the E-Mail alerts. You also have the option of adding your own custom text to the E-Mail that employees will see in the event that they attempt to add E-Mail to a device themselves. Once you have determine those two details, you can move forward by running the following script (this example contains the optional custom text).

Set-ActiveSyncOrganizationSettings -DefaultAccessLevel Quarantine -AdminMailRecipients mail@domain.com -UserMailInsert "Your mobile device has not yet been approved for E-Mail use. If you have any questions or concerns, please contact the IT Department of [Business Name] for further assistance."

Once this has ran, you will now have the ActiveSync Quarantine enabled within your Exchange server. Any new devices that are configured for E-Mail access will now be put into this quarantine, pending an Administrator's approval.

Stay tuned for Part II, where we go over the quarantine approval process, along with how to delegate access to this feature for your team.

March 3, 2016

If you find yourself with the responsibility of managing an Exchange Server 2010 environment, then you will be all too familiar with using the Exchange Management Console. This utility is installed as a part of your Exchange server setup, and provides a graphical interface for managing your entire Exchange environment. By default, this management utility is only accessible from within your Exchange server itself. Fortunately, it is fairly simple to install both the Exchange Management Console and Exchange Management Shell (for PowerShell) on your own workstation. Prior to this, however, there are a few prerequisites that will need to be taken care of.

Microsoft's Exchange Management Console is used to manage your entire Exchange environment.

The first requirement is to download and install the Remote Server Administration Tools, provided by Microsoft. This should be a straightforward installation, but may require a reboot. This particular toolkit is very useful for any Windows server administrator, which will be discussed further in a future post. For now, it is necessary for the task of installing the Exchange management tools.

Once Microsoft's Remote Server Administration Tools has been installed, and your workstation rebooted, you will need to install some IIS components. In order to install these components, you will need to launch Control Panel and select Programs. From here, select Turn Windows features on or off, located under the Programs and Features heading. Within this screen, select IIS 6 Management Console, which should automatically select IIS Metabase and IIS 6 configuration compatibility as well. The following screenshot shows these two components that are required to be installed.


Now you will need to download Microsoft Exchange Server 2010 Service Pack 3. Since this is a large installation file, it will likely take some time to download. Once it is completely downloaded, however, you can move forward with running the setup file. This should begin the extraction process of the installation files for Exchange Server 2010 SP3, and will prompt you for a location to extract the files to. These installation files can be extracted to any location of your choosing.


After the file extraction is complete, you can navigate to the specified directory and run the Exchange Setup file located there. On the initial splash screen for the Exchange installation, you will see prerequisites listed under the Install heading. If you are running a newer Operating System like Windows 10, then you should have both .NET Framework 3.5 SP1 and PowerShell v2 already installed on your workstation. If not, then you will need to do so now.

To begin the installation, click on Step 4: Install Microsoft Exchange.


On the Introduction screen, you can click Next to move on to the License Agreement. From here, select that you accept the agreement and click Next to continue. You will now have the option to opt-in to Exchange Error Reporting, which will automatically send error reports to Microsoft. This is entirely up to you whether you would like to participate or not, but once you have made your decision click Next.

You should now be on the installation screen which allows you to specify whether you will be doing a Typical install or Custom. This is the most important step when installing only the Exchange Server 2010 Management Console on your workstation. In order to do so, select Custom Exchange Server Installation and click Next. I would also recommend that you do not select to automatically install Windows Server roles and features.


You will now be able to select which Exchange server roles that you wish to install. In our case, you will only want to select Management Tools. Click Next once you have made your selection.


Setup should now go through its Readiness Checks. In the event that you have a missing requirement, you will be notified within this screen. If there are any issues, you will need to correct them before retrying. If everything goes well, however, then you should see the following.


You can now click Install to begin the actual installation of the Exchange Management Tools. This might take a few minutes to complete, but you will be given a summary of the progress of the installation. Once everything is completely installed, you can click Finish to launch the Exchange Management Console.


If you have installed this tool on a domain computer, it should automatically connect to your Exchange server. You will be able to verify this by expanding out the menu tree items on the left. In the event that the version of your Exchange Management Console does not match that of your Exchange Server, you will need to download and install the necessary Service Packs on your workstation. At this point, you should have both the Exchange Management Console and Exchange Management Shell installed on your workstation. You will no longer need to remotely access your Exchange server in order to manage your Exchange environment.

September 4, 2015

Two years ago, I wrote an article outlining how to output a list of mobile devices that are currently synced to your corporate Exchange server via Exchange ActiveSync. While this method provides you with a very good list of devices that have been synced to your Exchange server, it doesn't quite differentiate on the different Apple products in enough detail.

Running the following script, outlined in the previously discussed article, will give you DeviceModel results such as "iPad2C4" or even "iPhone7C2." If you are trying to determine the particular Apple product's model information, this doesn't quite give you what you are after.

Get-ActiveSyncDevice | Select-Object DeviceModel,FriendlyName,DeviceOS,UserDisplayName | Sort-Object DeviceModel | Export-CSV -Path C:\ActiveSync-Devices.csv -NoTypeInformation


Thankfully, there is a way to determine the actual device information using these semi-cryptic names. Using the below table, you could easily craft a Formula within Excel that would provide you with the detailed device description using what was contained within the PowerShell script ran against your Exchange server.

User-Agent Prefix
Apple Product Information
iPhone iPhone, 3G or 3GS with iOS 3.x
iPhone1C2 iPhone 3G with iOS 4.x
iPhone2C1 iPhone 3GS with iOS 4.x
iPhone3C1 iPhone 4 GSM
iPhone3C2 iPhone 4 GSM
iPhone3C3 iPhone 4 CDMA
iPhone4C1 iPhone 4S
iPhone5C1 iPhone 5 GSM
iPhone5C2 iPhone 5 CDMA
iPhone5C3 iPhone 5C GSM
iPhone5C4 iPhone 5C CDMA
iPhone6C1 iPhone 5S GSM
iPhone6C2 iPhone 5S CDMA
iPhone7C1 iPhone 6+ CDMA
iPhone7C2 iPhone 6 CDMA
iPod iPod touch 1st, 2nd or 3rd generation with iOS 3.x
iPod2C1 iPod touch 2nd generation with iOS 4.x
iPod3C1 iPod touch 3rd generation with iOS 4.x
iPod4C1 iPod touch 4th generation
iPod5C1 iPod touch 5th generation
iPad iPad with iOS 3.2.x
iPad1C1 iPad with iOS 4.2.x
iPad2C1 iPad 2 WiFi
iPad2C2 iPad 2 WiFi + 3G GSM
iPad2C3 iPad 2 WiFi + 3G CDMA
iPad2C4 iPad Mini - WIFI
iPad2C5 iPad Mini - WIFI + LTE
iPad3C1 iPad (3rd generation) WiFi
iPad3C2 iPad (3rd generation) WiFi + 4G Verizon / International
iPad3C3 iPad (3rd generation) WiFi + 4G AT&T / International
iPad3C4 iPad (4th Gen, WiFi Only)
iPad3C5 iPad (4th Gen, GSM, NA LTE)
iPad3C6 iPad (4th Gen, CDMA, LTE)
iPad4C1 iPad Air - WiFi
iPad4C2 iPad Air - WiFi + LTE
iPad4C4 iPad Mini with Retina Display - WIFI
iPad4C5 iPad Mini with Retina Display - WIFI + LTE

Just as an example, I created an Excel Formula to automate this process for me. In order to use the formula, I manually created a new column within the original output from Exchange (Column B), which this formula will be pasted into. I then added a new tab within the document to contain the above table's data. Tab 1, which was the original output, was named "ActiveSync-Devices" and the new tab was named "iOS Strings."

=INDEX('iOS Strings'!B:B,MATCH('ActiveSync-Devices'!A2,'iOS Strings'!A:A, 0))

Using this process, you will be able to expand upon the original PowerShell script in order to obtain further details upon the mobile devices connected to your Exchange ActiveSync.

May 29, 2013

If your corporate network happens to have Exchange 2010, chances are you may have employees with corporate email on their mobile devices. Exchange allows you to connect various mobile devices, whether tablets or smartphones, by way of Exchange ActiveSync (EAS). These devices may be part of a BYOD policy, or they may be provided by the company itself. In either event, you've got them tied to your Exchange server and as a Server Administrator, there may be a time where you need to report on what devices are currently synced.

Thankfully, with the installation of Exchange 2010 you will have access to a myriad of administrative tools, including numerous PowerShell cmdlets that can be ran through the Exchange Management Shell. You can find a complete list of cmdlets provided with Exchange 2010 on Microsoft's Technet page. One in particular is extremely useful in the task of reporting on ActiveSync devices, Get-ActiveSyncDevice.

Running this cmdlet as-is will provide you with an abundance of data in a not-so-user-friendly manner... so what do you do? If you've ever used PowerShell before, then you've probably used pipes to send the results of one cmdlet to another. This is very useful when you need to provide "cleaner" reports that include only the data you need, organized just the way you want it.

For example, let's take the output from Get-ActiveSyncDevice and pipe it into the Select-Object cmdlet in order to list only the objects we want to report on. So now we have:

Get-ActiveSyncDevice | Select-Object DeviceModel,FriendlyName,DeviceOS,UserDisplayName


This will now limit the data we will see for each ActiveSync device, but could still use some work to make it viewable within the PowerShell terminal. Let's pipe these results into the cmdlet Format-Table in order to size the table of data to the size of the PowerShell terminal:

Get-ActiveSyncDevice | Select-Object DeviceModel,FriendlyName,DeviceOS,UserDisplayName | FT -autosize -wrap


This should be much better than the original running of Get-ActiveSyncDevice, but let's say you want to sort the resulting data alphabetically by the DeviceModel object. To do this we'll add the Sort-Object cmdlet into the mix:

Get-ActiveSyncDevice | Select-Object DeviceModel,FriendlyName,DeviceOS,UserDisplayName | Sort-Object DeviceModel | FT -autosize -wrap


Now you should have the data you need, formatted just the way you want it. The only issue, it's still only viewable from within the PowerShell terminal. What if you want all of this formatted data in an Excel spreadsheet? PowerShell once again provides a way to do this, by way of yet another cmdlet. Let's replace the Format-Table cmdlet with Export-CSV to do this:

Get-ActiveSyncDevice | Select-Object DeviceModel,FriendlyName,DeviceOS,UserDisplayName | Sort-Object DeviceModel | Export-CSV -Path C:\ActiveSync-Devices.csv -NoTypeInformation


There you go! A well-formatted Excel spreadsheet containing all of the ActiveSync devices tied to your Exchange server.
Subscribe to RSS Feed Follow me on Twitter!