Category Archives: Exchange

Exchange 2010 tested commands

Exchange New-MailboxImportRequest – Import PST files

New-MailboxImportRequest -Name “Import1” -Mailbox “Test User” -FilePath \\ServerName\SharedFolder\Imported.pst -TargetRootFolder “Inbox/Imported” The above command will create a subfolder under the Inbox called “Imported” and all PST data will be imported into that subfolder. Get-MailboxImportRequest -Status Completed | Remove-MailboxImportRequest -Confirm:$all ( delete … Continue reading

Posted in Exchange | Leave a comment

Exchange – remove address from all groups and hide it from GAL

Filename:  script.ps1 $email = (read-host “email”) $GG = Get-DistributionGroup $RG = $GG  | where {(Get-DistributionGroupMember $_ | foreach {$_.PrimarySmtpAddress}) -contains “$email”} foreach( $dg in $RG ){ Remove-DistributionGroupMember $dg -Member $email } get-mailbox -Identity $email | Set-Mailbox -HiddenFromAddressListsEnabled $true  

Posted in Exchange | Leave a comment

Exchange – Add mailbox permissions to Domain Admins

Add-MailboxPermission -Identity alice.cooper -User “Domain Admins” -AccessRights Fullaccess -InheritanceType all

Posted in Exchange | Leave a comment

Exchange – Check Email forwarding using Powershell

Get-Mailbox -Filter {ForwardingAddress -ne $null} | ft Name,ForwardingAddress,DeliverToMailboxAndForward -Autosize | Export-CSV e:\Email_forwarding_output.csv

Posted in Exchange | Leave a comment

Reset password in Active Directory using PowerShell

  You must have the cmdlets ( part of the ActiveDirectory module for PowerShell v2 ) For Windows 7, you need to install the latest RSAT (Remote Server Admin Tools) and then add the Windows Feature for the PowerShell AD … Continue reading

Posted in Exchange | Leave a comment

Exchange 2010 View Disconnected Mailboxes

Get-Mailbox -Filter “exchangeuseraccountcontrol -eq ‘accountdisabled’”  | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft Displayname,TotalItemSize,Database

Posted in Exchange, Windows | Leave a comment

Exchange 2010 – Mailbox Traffic Report

View received e-mails for period: get-messagetrackinglog -ResultSize Unlimited -Recipient user@domain.com -Start “09/01/2014 12:00:00 AM” -End “09/30/2011 11:59:00 PM” | select timestamp, messageid, messagesubject, sender, {$_.recipients}, totalbytes, recipientcount | export-csv c:\somefolder\user-incoming.csv Add | measure-object to count the results; For sent e-mails … Continue reading

Posted in Exchange | Leave a comment

Exchange 2010 – Recover deleted items from Dumpster

The user simona.x managed to permanently delete (hard delete) an entire folder from Outlook. Can we recover her e-mails ? Thanks to Microsoft Transport Dumpster, data is stored for 14 more days (or custom) in the dumpster, before being purged. … Continue reading

Posted in Exchange | Leave a comment

Exchange – configure automatic replies using Shell

Use a variable and html to format text: $OOF=“Hi,<br>I am away until 14th August.<br>In my absence please contact Sara Rundel (E:sara.d@pilon.co.uk M:07700 000 000) with any queries.<br><br>Kind regards,<br>John Smith” Set-MailboxAutoReplyConfiguration john.smith -AutoReplyState Scheduled -StartTime “07/27/2017” -EndTime “14/08/2017” -ExternalMessage $OOF -InternalMessage … Continue reading

Posted in Exchange | Leave a comment

Your mailbox appears to be unavailable. Try to access it again in 10 seconds. If you see this error again, contact your helpdesk.

If as a Domain Admin you cannot open someone else’s mailbox: Remove-MailboxPermission -Identity username -User “DOMAIN\Domain Admins” -AccessRights FullAccess -Deny Add-MailboxPermission -Identity username -User “DOMAIN\Domain Admins” -AccessRights FullAccess Access to all mailboxes: $gm = get-mailbox $gm | ForEach-Object { add-MailboxPermission … Continue reading

Posted in Exchange | Leave a comment