Essential [email protected] powershell commands

At the heart of any [email protected] administrative tasks lies a powershell command.  Below is a quick listing of essential powershell commands that any [email protected] admin needs to know.

Creating a new mailbox in Powershell – Live

$Password = ConvertTo-SecureString ‘1234’ -AsPlainText -Force

new-mailbox -Name “Some User” -Password $Password -WindowsLiveID [email protected]

-ResetPasswordOnNextLogon 1 -FirstName Some -LastName User –DisplayName “Some User”

Resetting a user’s password:
Set-Mailbox [email protected] -Password (ConvertTo-SecureString -String ‘Pa$$word1’ -AsPlainText -Force) -ResetPasswordOnNextLogon $true

Creating a Mailuser

new-mailuser -Name “Some User” -externalemailaddress “[email protected]

Enabling a mailuser

enable-mailuser -Identity auser0001 -ExternalEmailAddress [email protected]

Evict an unmanaged Windows Live ID:

New-Mailbox -Name “SomeUser” -WindowsLiveID [email protected] -Password (ConvertTo-SecureString -String ‘Pa$$word1’ -AsPlainText -Force) -EvictLiveId

Connect to Live Powershell

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LiveCred -Authentication Basic -AllowRedirectiond

Hide All New Users in [email protected]

Set-MailboxPlan GalDisabledMailboxPlan -IsDefault

Mass Updating Targetaddress ObjectAttribute in Powershell using PowerGui with Quest AD Powerpack

$searchRoot=“Your DN goes here”

Get-QADUser -SearchRoot $searchRoot | ForEach-Object ($_.samaccountname) {$email = $_.Samaccountname +”@domainsuffixgoeshere” ; Set-QADUser -ObjectAttributes @{targetAddress=$email} -Identity $_.SamAccountName}

Back to top button