Exchange

Remove public folder user with multiple access rights

Posted on Updated on

I have come across an issue where users are assigned different permissions on public folders and I need to remove them fast.

Here is a link where I got the idea on how to go about doing it:  http://blogs.technet.com/b/dblanch/archive/2013/12/03/managing-exchange-public-folder-permissions.aspx

And here is the final script that worked for me:  Example entries for user can be “*lastname*”, “*NT USER:*” for deleted users

$test = Get-PublicFolder “\public folder\folder1” -Recurse | Get-PublicFolderClientPermission | ?{$_.User -like “*user*“} $test | ForEach {Remove-PublicFolderClientPermission -Identity $_.Identity -User $_.User -AccessRights $_.AccessRights -WhatIf}

I hope this script would help other users out there who are running into the same issue as I am.  Please leave a comment if you have any questions.

How to export a mailbox using Exchange PowerShell

Posted on Updated on

Here I am going to show you how to archive mailboxes to PST and how to deal with errors along the way.  When I first attempted the export in Exchange 2010, I ran across 2 error messages which prevented me from exporting a mailbox.  Below are the steps I performed to correct the issue.

1.  The very first step is to make sure the user running the export command have necessary permissions:

In Exchange 2010 ECP, go to Roles & Auditing and you may have to add a new Role called ‘Mailbox Import Export Role’ to the user.  Under Role Groups, select New, Enter the Name of the Role and you can set the scope to default.  Under Roles, add ‘Mailbox Import Export Role’ and under members, add the group or user who will be running the export command.

If the role is not setup before running the export, the process will have an error ‘Couldn’t find the Enterprise Organization container’.

2.  Next step is to create a share, preferably on the Exchange server to where all the archive emails will be saved.  Make sure to add FULL share and security permissions for Exchange Trusted Subsystem (normally found in your root domain – root\Exchange Trusted Subsystem) and SYSTEM.  If you are running the Information Store with a specific service account, then you will have to add that account too.

If the permissions are not setup correctly, an error will be displayed after running the export command: ‘Unable to open PST file ‘\\location\name.pst’.  Error details:  Access to the path is denied.

Note:  When I tried to google for an answer to this error message, I only came across articles suggesting to add the ‘Exchange Trusted Subsystem’ to the shared folder.  And unfortunately, it did not fix my issue.  I found the SYSTEM in all of my built-in Exchange shares and that is what lead me to the resolution.

3.  Export the mailbox by running the command:

New-MailboxExportRequest -Mailbox name -Filepath \\UNC_path_from_step_#2\name.pst

4.  After successfully running the export command, you can run the Get-MailboxExportRequest to see the status of the export.

I hope this article helps other users out there who are trying to export mailboxes for the first time.

How to free up Exchange log drive space when it fills up

Posted on Updated on

There are a couple of instances where I had to free up the log drive on our Exchange server because the drive is full.  This has happened to me multiple times even with alerting setup and do diligence.  There are just some disasters you cannot prevent – like your Marketing or Ebusiness department decided to send 50,000 campaign emails in an hour filling up your Exchange outbound queue and ended up filling up your log drives too.

When the log drive fills up, Exchange will also automatically dismount your mailbox database associated to the log drive to prevent database corruption.

First thing to do when this happens is CALM DOWN and DON’T PANIC!  You can be back up and working again in a matter of seconds.  Tell your boss not to stay behind you and breath on your neck while you resolve the issue :).

Here are the things I normally do when this issue happens:

1.  Login to the Exchange server and locate the checkpoint file in the log drive.  The checkpoint file has an extension of .CHK and normally starts with E0x.

2.  Run eseutil.exe /mk “path\name.chk” to find out what logs are still needed and what can be safely moved/deleted.  In my example below, I ran the command eseutil.exe /mk e04.chk while I am inside the logs directory.  The result will show you the checkpoint or last log that was committed.

ESEUTIL

3.  Based on the result, all logs previous to the checkpoint can be safely moved/deleted (I don’t recommend deleting just in case you need them back or you overlooked what files are still needed).

If your checkpoint file is e04.chk then your log files will start with e04 followed by 000 and then the checkpoint HEX.

Example:  e040001810F is the checkpoint log

All files starting with e040001810E and older can be safely moved to another location to free up space.

4.  Once the old log files are moved, go back to the Exchange Management Console and mount the mailbox database.  To save your users, you can immediately try to mount the database after freeing up a couple of megabytes on the log drive.   I would already try to mount the database if I see more than 200MB of freed space.  So your users can already login to their mailboxes while you are still freeing up more space.  And that will make the boss happy.

Note:  If you are unable to mount the mailbox database after the cleanup, make sure that the database is not corrupted.   This issue almost never happens but if it does happen to you, you may have to restore from backup or repair the database.

To prevent future issues, first let your Marketing or eBusiness group send the emails by batch if possible.  🙂 Or enable circular logging for the mailbox database which is by default turned ON.  Also, make sure that your Exchange backup is running successfully each night which will also truncate the logs for you.

How to check and disable Transport agents in Exchange

Posted on

To get the list of Transport agents running on your Exchange server run the command:

Get-TransportAgent

And to disable a specific agent:

Disable-TransportAgent -identity “transport agent name”

How to find the owner of an alias in Exchange

Posted on

To find out who the owner is for an alias or email address in Exchange.  You should be able to run the following exchange powershell command:

get-recipient -results unlimited | where {$_.emailaddresses -match “emailaddresshere”} | select name,emailaddresses,recipienttype

Deleting email from multiple mailboxes

Posted on Updated on

Here is the process on how to delete an email from multiple mailboxes via Exchange PowerShell

Get-Mailbox -Database <DbName> | Export-Mailbox -SubjectKeywords “Subject” -DeleteContent

Make sure that the user who is running the command has FullAccess permission to the mailboxes.

In Exchange 2010 SP1 the command is:

Get-Mailbox -Server <ServerName> | Search-mailbox -SearchQuery ‘Subject:”subject here”‘ – DeleteContent

 

How to configure Mailtips in Exchange 2010

Posted on Updated on

MailTips is by default enabled in a fresh install of Exchange 2010.

Here is a link to TechNet:

http://blogs.technet.com/b/ferris/archive/2010/03/30/howto-configure-mailtips-in-exchange-server-2010-here.aspx