Script To Export Then Disconnect an Exchange Mailbox

A situation came up where I needed to be able to remove a user’s mailbox, but his supervisor wanted a copy of the contents in the form of a pst file. It would be easy enough to export the mailbox then go back later to disable it manually, but where’s the fun in that? This script accomplishes the same thing in a much more hands-off […]

Read Me Leave comment

Adding an Employee ID Number to Active Directory

The Active Directory database contains two fields that can be used to store an employee ID number: EmployeeID EmployeeNumber Neither field is used for anything currently, and neither one shows up in Active Directory Users & Computers or Active Directory Administrative Center by default. ADUC can be modified to display one or both of the two available fields (See here for example), but I don’t […]

Read Me Leave comment

Assign the value of ObjectGUID to a string variable in Powershell

The ObjectGUID property of an AD object is weird. I tried using -Expand and foreach{$_.ObjectGUID} to extract the value, but neither did quite what I expected. Here’s how I was able to get the value of that property into a string variable that I could then use for something useful. $uGuid = (Get-ADUser <username> | Select -Expand ObjectGUID).toString() The value of $uGuid will be the […]

Read Me Leave comment

Get a List of Mailbox Folders Sorted by Size

It doesn’t matter if an end user gets so much email that it’s impossible to manage, gets a lot of really important email that can’t be deleted, or is just really bad at managing their stuff, many end users will always complain about not having enough storage space for their mailbox. We all know the standard instructions: Configure auto-archiving or online archiving, save attachments separately […]

Read Me 2 Comments

List Mailbox Databases in Order of Size

This is a quick and easy cmdlet for listing all of your mailbox databases in order of size. Get-MailboxDatabase -Status | Sort-Object DatabaseSize | FT Name, DatabaseSize, Server

Read Me Leave comment

Remove permission from every folder in a mailbox with one command

  Here’s the third promised script for managing shared mailbox folder permissions. This one gets a list of all folders in a mailbox (SharedMailbox) and then removes all permissions for the specified user (John.Doe). Remove_Perms SharedMailbox John.Doe If a deleted account has permissions to a mailbox folder, it will still be listed in the ACL. If you run Get_Perms against that mailbox, you’ll see something […]

Read Me 1 Comment

Grant permission to every folder in a mailbox with a single command

This is the second of three scripts I mentioned in my previous post. Running this command as shown here from the Exchange Management Shell: Add_Perms SharedMailbox John.Doe will get a list of all folders in a mailbox called SharedMailbox and then add Publishing Editor permissions for John.Doe to each of those folders. The username can be entered as account name, primary SMTP address, alias, or […]

Read Me 3 Comments