Thursday, 15 September 2016

View and Change Exchange Mailbox Calendar Permissions with Powershell

Permissions for mailbox calendars are managed separately to the actual mailbox permissions. You can use the below cmdlets in powershell to view and add/edit the permissions on a users mailbox.

To view current calendar permissions on a mailbox

get-mailboxfolderpermission -identity "name:\Calendar" | ft

To add new calendar permissions on a mailbox

add-mailboxpermission -identity "name:\Calendar" -User "usertogetaccess" -AccessRights "Accesslevel"


To modify an existing calendar permissions entry on a mailbox

set-mailboxfolderpermission -identity "name:\Calendar" -User "usertogetaccess" -AccessRights "Accesslevel"

To remove an existing calendar permissions entry on a mailbox

remove-mailboxpermission -identity "name:\Calendar" -User "usertogetaccess" -AccessRights "Accesslevel"

Name = the display name alias or email address you are setting the calendar permissions ON
Usertogetaccess = the display name, alias or email address you are granting calendar permissions TO
Accesslevel = the level of access to be granted. The available options are:
  • Owner
  • Publishing Editor
  • Editor
  • Publishing Author
  • Author
  • Nonediting Author
  • Review
  • Contributor
  • Free/Busy Time
  • None

Wednesday, 14 September 2016

Check which Exchange Mailboxes a User has Full Access or Send As Permissions On using Powershell

As an exchange administrator, you may occassionally need to know which mailboxes a particular user has Full Mailbox Access or Send As permissions to. This may be required as part of an audit, or to simply copy an existing users permissions for a new user you are setting up/creating.

The script below helps to accomplish this, as there is no in-built/easy way to view which mailboxes a particular user has access to - ie. Full Mailbox Access, or Send As permissions

First you need to specify the user whose existing access we are checking, using the $user variable. We use the wildcard "*" to essentially match any name that contains what is between the *'s - the users first name, last name or alias should work.

$user = "*peter*"

Next we run the get-mailbox cmdlet against all mailboxes in exchange, to query the permissions on each mailbox to see if this user exists in the respective permissions list.

There are two separate commands to do this - one to check for Full Access permissions, and the other to check for Send As permissions

get-mailbox -resultsize unlimited | get-mailboxpermission | where {$_.user -like $user} | select Identity, AccessRights

get-mailbox -resultsize unlimited | get-adpermission | where {($_.user -like $user) -and ($_.ExtendedRights -like "*Send-As*")} | select Identity, ExtendedRights

If any matches are found, the results will be displayed showing their Identity (ie. name) and the Access Rights level they have

Tuesday, 13 September 2016

Export All Exchange Mailbox Sizes with Powershell

Here is a script you can run on your exchange server to export a list of all mailboxes on the server and the size of each mailbox. This is useful for checking/monitoring mailbox size and usage.

First of all we need to get the name of the mailbox database to query

$mbdb = get-mailboxdatabase | select Name

Next, we use this database name in the get-mailboxstatistics cmdlet to query all mailboxes within the database and export the size from the TotalItemSize field. The list is then sorted alphabetically by display name and exported to a .csv file so it's easier to view

get-mailboxstatistics -database "$($dbname.name)" | select DisplayName, TotalItemSize | sort DisplayName | export-csv "C:\1GB-MailboxList.csv" -notype

You can also implement a "filter" of sorts so that you only export mailboxes that are bigger than a certain size. For example, you may want to know how many mailboxes you have that are larger than 1GB. To do this, we add a filter using the "where {$_.totalitemsize -ge $size}" where $size is the size value you need, in bytes.

So for the example of 1GB, the $size variable would be set to 1073741824 which is 1GB in bytes.

There is a handy utility you can use by following the link below to quickly convert the size you require from GB to bytes

http://www.convertunits.com/from/GB/to/byte

$size = "1073741824"

get-mailboxstatistics -database "$($dbname.name)" | where {$_.totalitemsize -ge $size} | select DisplayName, TotalItemSize | sort DisplayName | export-csv "C:\1GB-MailboxList.csv" -notype

Monday, 12 September 2016

Windows Server - Unable to extend volume - There is not enough space available on the disk(s) to complete this operation

Came across this issue today on a virtual machine running in a VMware environment. After allocating additional hard disk space to the virtual machine (running Windows Server 2012), the following error appeared when attempting to extend the hard disk;



"There is not enough disk space available on the disk(s) to complete this operation"

Even though the space was showing as "unallocated" in disk management, this error still appeared when trying to extend the volume.

The fix - turns out it was quite simple. From within the Disk Management utility, go to Action > Rescan Disks then try running the extend disk again.


Friday, 9 September 2016

Get ActiveSync Enabled Accounts/Mailboxes using Powershell

Here is a short/simple script you can use to obtain a list of all mailboxes within your Exchange environment that have the ActiveSync service enabled on them.

#Add Exchange Cmdlets
add-pssnapin *exchange* -erroraction SilentlyContinue

get-casmailbox -resultsize unlimited | where {$_.ActiveSyncEnabled -eq $true}

The output will now be displayed showing all mailboxes in your environment that have ActiveSync functionality enabled on them.

You can export your results to a .csv by adding a bit more to the end of the command as per below. You can of course change the output path as required

get-casmailbox -resultsize unlimited | where {$_.ActiveSyncEnabled -eq $true} | select Name, ActiveSyncEnabled | export-csv "C:\activesyncusers.csv" -notype

Thursday, 8 September 2016

Exchange 2010 New Install - Nothing Showing Under Microsoft Exchange On-Premises

After installing Microsoft Exchange Server 2010 onto a Windows Server 2012 R2, nothing was showing under the Exchange Management Console after expanding "Microsoft Exchange On-Premises".

Everything under "Exchange 2010 Organizational Health" was showing as "Unavailable"



When selecting the option to "Collect Organizational Health Data", the below error occurs stating "MMC has detected an error in a snap-in and will unload it"



To resolve this issue you need to install the latest Service Pack (SP3) for Microsoft Exchange Server 2010 - available from the following URL:

https://www.microsoft.com/en-us/download/details.aspx?id=36768

You can then install Update Rollup 14 for Microsoft Exchange Server 2010 SP3 from the following URL:

http://go.microsoft.com/fwlink/p/?LinkId=820579

As you can see below, once SP3 has been installed, the Configuration options are now available/showing under "Microsoft Exchange On-Premises" after the updates are installed

Wednesday, 7 September 2016

Restoring Files & Folders from Backup - Macrium Reflect

As outlined in my previous blog post, we have setup a full backup of your PC using a free and easy to use product called Macrium Reflect.

Once you have a full backup image file available, you can open, explore and restore files from it which is what we'll be covering in this blog post.


  1. Open windows explorer and browse to the location of your Macrium Backup image file (the file will have .mrimg on the end of it)
  2. Right click on the image file and select "Explore Image"

  3. Macrium will now load a "Backup Selection" screen where you can select which of the hard drives you backed up you wish to "mount" in windows explorer. In most cases (and this example), there will be one drive available (C:), so select it by placing a tick in the box next to it then click OK.

    You can also select the option to "Enable access to restricted folders" if you wish to access files that would normally be restricted (such as files in another users profile/account)
    Also note the "Drive Letter" that is specified - in this case H:\

  4. Windows Explorer will now mount the image and open Windows Explorer to show the files contained within it. As per the screenshot below, you can see H:\ is available and is called "Macrium Reflect Image". From here, you can view/browse all the files within the image. If you wish to restore/recover files from within this image, you can simply copy and paste them from this image drive, back to your C:\ or other folder as required

  5. Once you are done, you need to "unmount" the macrium image file. To do this, right click the macrium image drive letter (H:\ in this example), then go to go Macrium Reflect > Unmount Macrium Image