Posts

Showing posts with the label Microsoft Exchange 2007

Office 365 Send As

We've been using Microsoft Exchange 2007 and 2010 for many years now and I've always used the add-receipientpermission command to give the users the SendAs permission. Today I had to do it for a company that is using Office 365. After a google search I found out that I could load a session and connect to the server that's hosting the mailboxes: First of all you have to create a variable for the credentials that you're going to use with the following command:     $cred = get-credential Then you have to create a session object for Microsoft Exchange using the following command:     $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $cred -Authentication Basic -AllowRedirection And import it using:     Import-PSSession $Session After that you're ready to configure the appropriate permissions:     Add-RecipientPermission -Identity target@exa...

Microsoft Exchange 2007 and Email Forwarding

A very common scenario is the one where you are using Microsoft Exchange Server 2007 as your communication system and you have users that want their messages to be forwarded to another address. For example, your domain is foo.com and you have a user that already has an email account at bar.com. If you do not want to create a mailbox on your exchange you can simply create a mail contact and on that mail contact you have to set the address at bar.com as Reply and External and add the address that you want the contact to have on your organization.

Microsoft Exchange 2007 Agent Logs

Unfortunately, the logging for the rejected or deleted messages in Exchange Server 2007 is a bit poor. There is a set of commands that may help examining the log: Display the log for the specific period: Get-AgentLog -StartDate “4/16/2007″ -EndDate “4/17/2007″ Get-AgentLog -StartDate “4/17/2007 8:00 AM” -EndDate “4/17/2007 2:00 PM” Filtering in order to show messages to a particular recipient : Get-AgentLog -StartDate “4/16/2007″ -EndDate “4/17/2007″ | where {$_.recipients -like “foo@yourdomain.com”} To search for messages from a particular sender : Get-AgentLog -StartDate “4/16/2007″ -EndDate “4/17/2007″ | where {$_.P1FromAddress -like “aqe@easymoney2u.com” -or $_.P2FromAddresses -like “aqe@easymoney2u.com ”} There are more commands, that can help you filter the log for the agent or the host IP address and other stuff.   Many thanks to Bharat Suneja for this article.  

Microsoft Exchange 2007 Permantly Delete Mailbox

When you delete a mailbox in Exchange Server 2007 using the Exchange Management Console or the remove-mailbox command in Exchange Management Shell the mailbox remains on the server for a specified period of time. You can get all the disconected mailboxes by using the following command on Exchange Management Shell: Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid This command displays the name of the user and the GUID of the mailbox so you can use it in order to delete it. To remove a single mailbox you can use the this command: Remove-Mailbox -Database <Database-Name> -StoreMailboxIdentity <MailboxGuid> -confirm:$false You can delete all the disconected mailboxes with this command: Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName, MailboxGuid, Database |  ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false } Be very...