PowerShell

Removing an auto-mapped mailbox

In Exchange Server 2010 SP1, shared mailbox with full access rights will be auto mapped to the users given such rights. This is fine for that user who doesn’t seem to know how to add an additional mailbox to their Outlook 2007, 2010, 2013 client. But what about those support and systems admins who grant themselves access for troubleshooting and find out later they are stuck with this new folder under their Outlook folder that can’t be removed.

Well we never say “can’t”. So what you need to do to remote the auto-mapping attribute is to reach out to the administrator if you are not one or if you are just find your way to the Exchange Management Power Shell and issue the following command:

Add-MailboxPermission -Identity <shared mailbox alias> -User <your mailbox alias> -AccessRights FullAccess -InheritanceType All -Automapping $false

Once this command is run the additional mailbox will automatically be removed.

Reference: Disable Outlook Auto-Mapping with Full Access

Simple Exchange 2010 Database White Space Report

I was looking at some of my database on Exchange that seemed to be very large in size so first thought was that an offline defrag may be needed, but before I reach that point I wanted to know how much ‘slack’ or white space existed in each of my Exchange databases.

This was done by using the following command syntax in the Exchange Management Shell:

To export this into a CSV format the following can also be done, so that you can give to any management members for review of your findings:

Next, I may find a way to setup this to email a weekly report…

ESEUtil to Defrag an Exchange 2010 Mailbox Database

A garden is a complex of aesthetic and plastic intentions; and the plant is, to a landscape artist, not only a plant – rare, unusual, ordinary or doomed to disappearance – but it is also a color, a shape, a volume or an arabesque in itself. – Roberto Burle Marx

 

 

How To use ESEUtil to Defrag an Exchange 2010 Mailbox Database

We start this process by first opening the Exchange Management Shell and navigate to the folder containing the database file.

We then dismount the database

[PS] E:MailboxAB>Dismount-Database <name of database>

We now run ESEUtil to defrag the file using the /d switch to defrag

[PS] E:MailboxAB>eseutil.exe /d .<database name>

When completed we mount the database again.

[PS] E:MailboxAB>Mount-Database <database name>

Please see the following screen cap for refrence

And as always be sure that you have a backup that you can use for recovery if something goes wrong during the defrag.

Determining Free Space in an Exchange 2010 Mailbox Database

In Exchange 2010 you can see how big your mailbox databases are, and how much white space they have, by running the following command in the Exchange Management Shell.

[PS] C:>Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace -auto

In screen-cap database AB is 64.76 GB in size but has 11.97 MB white space due to mail deleted. This is a nice clean server post migration.  As time goes on the white space will grow and the need to defrag will be required to free up unused space.  — this I will go into at in another post.

– jermal

Upgrade Windows Server without Re-installing

Like in my previous post, we will be using the DISM.exe command (Deployment Image Servicing and Management Tool), that is available in Windows 7 and Windows Server 2008 R2. This time to change the version of Server 2008 R2 from Standard to Enterprise Edition.

Click on the “Start Button” Type Power, PowerShell will then show under programs, Right Click the PowerShell Icon and select “Run as administrator.

Enter the following command to see which version you can in place upgrade too “DISM /online /Get-TargetEditions”

You can see from the output of the command window, Windows Server 2008 R2 Standard can be upgraded to Enterprise and DataCenter.

Enter in the following command to upgrade your version of Windows Server R2. In my case I am going to upgrade to Windows Server 2008 R2 Enterprise Edition, by using the following command

DISM /online /Set-Edition:ServerEnterprise /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX”

You need to have a key for Enterprise edition and fill in the XXXX with that information. You can also use a KMS Key to active using this method.

Once the computer restarts, you will now see you are running Windows Server Enterprise.

Know Errors:

“Setting an Edition is not supported with online images” the reason you are getting this error is because the server you are trying to in place upgrade has the AD DS Role installed and is acting as a domain controller. You server you are trying to in place upgrade us holding an Exchange Server Role.  From what I can tell, you will need to install new at this point.

– Jermal

Version of Server Install via PowerShell and DISM

Today’s command that we are going to use is the DISM.exe command (Deployment Image Servicing and Management Tool), that is available in Windows 7 and Windows Server 2008 R2.

More on this here <– click that

On the server you want to run this command open up PowerShell as an administrator. Click on the “Start Button” Type Power, PowerShell will then show under programs, Right Click the PowerShell Icon and select “Run as administrator.

Enter is this command in the window to find the version you are running, just to confirm. “DISM /online /Get-CurrentEdition”  You will get something like the following:

Now wasn’t that fun

Find my Exchange 2010 version with the help of PowerShell

You have exchange running.  What’s this; Microsoft has released SP2.  Well what version am I running. The answer is simple to obtain with a quick little PowerShell fun you can have it in seconds.

First you will need to run the Exchange Management Shell. Once you have this running you will issue the following command:

Get-ExchangeServer | select name, admindisplayversion | ft -AutoSize

Create New Exchange 2010 Mailbox Database with PowerShell

Here is a short hot-to use the PowerShell to create a new exchange mailbox database. I recently learned how to do this when setting up databases for my new Exchange 2010 setup and again today I went over the steps. Today I will share them with you.

 

First you will need to run the Exchange Management Shell. Once you have this running you will issue the following command:

new-mailboxdatabase -name ‘database-1’ -server ‘EXCHANGE’ -edbfilepath ‘E:Mailboxdatabase-1database-1.edb’ -logFolderPath ‘F:Mailboxdatabase-1Logsdatabase-1_Logs’

After you have created your database its time to mount, this is also done in the Exchange Management Shell.  Simply type the following:

mount-database -identity ‘database-1’

If you go to the EMC, you will see that the new database has been made and now mounted.

SharePoint Server 2010 Windows PowerShell cmdlets

For those looking for essential resources when upgrading from MOSS 2007 to SharePoint Server 2010, I have found some of these very useful

Index of SharePoint Server 2010 Windows PowerShell cmdlets
http://technet.microsoft.com/en-us/library/ff678226(office.14).aspx