• Microsoft Exchange Server,  Network Infrastructure,  Windows Server

    Delete Messages From Exchange Using PowerShell

    Before I type anything else, allow me to state that running a search and deleting things with a script from a users (or a loop of all users) is a very dangerous process. However, I’ve often noticed that an outbreak of bad things can cause us to do some pretty awesome things. So, you can use the get-Mailbox cmdlet to pipe a mailbox into the search-mailbox cmdlet and from there use the -SearchQuery option to search for an attachment, following the attachment option with a filename and then delete it using the -DeleteContent option. The example would be as follows: Get-Mailbox -Identity “cedge” | Search-Mailbox -SearchQuery attachment:ichatsmileys.pkg.zip -DeleteContent You can…

  • Microsoft Exchange Server

    Exchange 2007: Can't Create User with Forwarding Address

    How many times do you go to create a user and find that it’s already there, or at least the forwarding address is.  Info@, sales@, etc.  Well, in Exchange 2007 you can final all the users with a forwarding address in them to quickly isolate who already has your address.  To do so, use the following command: Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Select Name, ForwardingAddress, DeliverToMailboxAndForward