TechShizz | All posts tagged 'Exchange 2016'

List all SMTP addresses with PowerShell

Open PowerShell > 


Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}}

Office 365: Security, Distribution and Dynamic Distribution groups - (Power Shell)

Create and view a mail-enabled security group

New-DistributionGroup -Name "GroupA" -alias groupa -Type security

Get-DistributionGroup GroupA | FL Name,RecipientTypeDetails,PrimarySmtpAddress


Create a mail-enabled distributiongroup

New-DistributionGroup -Name "GroupB" -Alias groupb -MemberJoinRestriction open

Create and view a dynamic distributiongroup

New-DynamicDistributionGroup -IncludeRecipients MailboxUsers -Name "Marketing Dynamic Group" -Department Marketing

How do we know this worked?

Get-DynamicdistributionGroup -Identity "Marketing" | Format-List

Room and Equipment Mailboxes - AKA Resource Mailboxes - (PowerShell)

Create and Configure a room mailbox

New-Mailbox -Name "Meeting Room A" -Room

Set-CalendarProcessing -AutomateProcessing AutoAccept


Create and Configure an Equipement mailbox

New-Mailbox -Name "Loan Laptop 1" -Equipment

Set-CalendarProcessing -AutomateProcessing AutoAccept


Change Mailbox Type

Set-Mailbox -Type Regular

Get-Mailbox -Identity | Format-List RecipientTypeDetails

Configure additional proxy addresses in PowerShell

Configure additional Proxy addresses
$users = Get-Mailbox
forech ($a in $users){$a.emailaddresses.add("smtp:$($.alias)@thenewdomainname")}
$users | %{Set-Mailbox.$_.Identity -Emailaddresses$_.EmailAddresses}

Configure Additional Addresses using a CSV file

Import-CSV "C:\addaddresses.csv" | ForEach {Set-Mailbox $_.Mailbox -EmailAddresses @{add$_.NewEmailAddress}}