Category Archives: Exchange

Windows Exchange 2010 – Remove log files

Exchange server logfiles can grow very fast!

There are either logfiles in the directory ‘Mailbox Database’ or in ‘Public folder database xxxxxxx’.
I’ve create a .bat file which delete all log files aged 2 days and older:

forfiles -p "C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\Mailbox Database 0258665593" -m E000*.log -d -2 -c "cmd /c del @path"
forfiles -p "C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\Public Folder Database 0449853521" -S -m E01*.log -d -2 -c "cmd /c del @path"

You can copy the code above and make sure the directory suits your environment.
Save it as a .bat file and put in the task manager to run everyday, for example.

Exchange 2010 – Completely remove a mailbox

Whenever you delete a mailbox from Exchange 2010 the mailbox is not deleted completely from the server.
To remove the mailbox you have to execute the following commands:

Clean-MailboxDatabase "Mailbox Name"
When you now open Exchange Management Console and go to Recipient Configuration and then Disconnected Mailboxes you will see the the mailbox you just deleted there.
To now delete all mailboxes with the disconnected state you have to execute this command:
Get-MailboxStatistics -Database "Mailbox Name" | Where-Object {$_.DisconnectReason -eq "Disabled"} | ForEach {Remove-StoreMailbox -Database $_.database -identity $_.mailboxguid -MailboxState Disabled}

Exchange 2003 – Create a mail enabled Public Folder

If you want to create a Public Folder in Exchange 2003 you have to:
Open the Exchange System Manager and go to:
Administrative groups -> ‘Administrative group’ -> Folders -> Public folders.
Right click on ‘Public Folders’ and select New -> Public Folder.
Now give the public folder a name.

When done you can press Apply or Ok.

If you want to public folder being able to receive mail, you can right click on the just created Public Folder and choose Tasks -> Mail enable.
In the properties of the public folder you can assign an email address to the public folder.

Exhange 2010 – Enable calendar sharing via internet

By default the function to publish your calendar to the internet is turned off / greyed out.

To enable this function log in to the Exchange server and open the Exchange management shell.
There are different options for this policy.

For sharing only the free/busy data you have to type:
New-SharingPolicy -Name “Calendar Sharing Policy” -Domains “anonymous:calendarsharingfreebusysimple”

If you want to have the ability to share the full calendar with all details you have to type:
New-SharingPolicy -Name “Calendar Sharing Policy” -Domains “anonymous:CalendarSharingFreeBusyReviewer”

Now you have to apply the sharing policy to a user:
set-mailbox -SharingPolicy “Calendar Sharing Policy”

When you log in to the OWA go to:
Calendar -> Share -> publish this calendar to internet

Choose the settings you like and click Save.

You will now see 2 URL’s.
1 is for viewing the calendar in a webbrowser, the other is for adding the calendar to Outlook.

To add the calendar to Outlook copy the link with .ics as extension.
Go to Oulook and go to: Calendar -> Open calendar -> from internet and paste the URL.

You have now enabled internet calendar sharing and added it to your Outlook!

Cant sync phone Microsoft Exchange ‘The connection to the server failed’

When you get this error you should see the following event in the event viewer on the Exchange server.
Event ID: 1008
Source: MSExchange ActiveSync

An exception occurred and was handled by Exchange ActiveSync. This may have been caused by an outdated or corrupted Exchange ActiveSync device partnership. This can occur if a user tries to modify the same item from multiple computers. If this is the case, Exchange ActiveSync will re-create the partnership with the device. Items will be updated at the next synchronization.

Make sure the user who is trying to connect with his phone has the option ‘Include inheritable permissions…’ checked on.
(Active directory -> right click the user -> properties -> security -> advanced -> ‘Include inheritable…’).

Note: If  you don’t see the option ‘Security’ go to Active directory -> view menu -> check ‘Advanced Features’.

OWA 2010 – Options button (“Sorry! Access denied”)

OWA 2010 – Options button (“Sorry! Access denied”)

When you get the above error message, you have a problem that the user doesnt has an ‘Default Role Assignment Policy’.
You can check this by logging in to the exchange server and open the Exchange Shell, then type: Get-mailbox “user” | fl RoleAssignmentPolicy.
If nothging appears after ‘RoleAssignmentPolicy’ do the following:

#1 Open Exchange management console
#2 Go to ‘Toolbox’
#3 Open ‘Role Based Acces Control (RBAC) User Editor
#4 Log in with Administrator
#5 Go to ‘Mailboxes’ and dubbleclick the user you want to edit.
#6 Unfold ‘Mailbox Settings’ and choose ‘Default Role Assignment Policy’

Now log in to /owa again and try the Options button!

Exhange – Outlook Web Acces options ‘file or directory not found’

When you press ‘options’ in Outlook Web Acces (owa) you get:
Server Error
404 – File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

To resolve this issue do the following:
1. On the exchange server go to: IIS – Default Web Site – ecp/owa
2. Click on HTTP Redirect
3. Uncheck ‘Redirect request to this destination’
4. Restart IIS Admin service

Test it. =)