# encoding: ascii
# api: powershell
# title: Check e-mail access type
# description: Want to know what type of access a user has to Exchange server?
# version: 0.1
# type: script
# author: Osnilton K M
# license: CC0
# x-poshcode-id: 3924
# x-archived: 2013-02-04T05:01:49
# x-published: 2013-01-31T10:17:00
#
# Whether Outlook Web App or Active Sync access?
# Check this script out.
#
$ErrorActionPreference = "silentlycontinue"
$login = read-host -prompt "Type the user login"
$Status = @( Get-ADuser $login | select SamAccountName).count
If($Status -eq 0) {
Write-Host No such user exists! -FOREGROUNDCOLOR RED
./the_script_name.ps1
} Else {Write-Host Working on it! -FOREGROUNDCOLOR GREEN
}
Get-Mailbox $login | Get-CASMailbox