6.3 KiB
6.3 KiB
Quick reference for Service Desk administration tasks.
Exchange Online PowerShell
Install Exchange Online Module
Run once:
Install-Module ExchangeOnlineManagement -Scope CurrentUser
Verify installation:
Get-Module ExchangeOnlineManagement -ListAvailable
Enable PowerShell Script Execution
Check current policy:
Get-ExecutionPolicy -List
Enable scripts for current user:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Temporary bypass for current session:
powershell.exe -ExecutionPolicy Bypass
Connect to Exchange Online
Import module:
Import-Module ExchangeOnlineManagement
Connect:
Connect-ExchangeOnline
Connect with a specific account:
Connect-ExchangeOnline -UserPrincipalName username@company.com
Verify connection:
Get-ConnectionInformation
Disconnect from Exchange Online
Disconnect-ExchangeOnline -Confirm:$false
Find Distribution Lists
Search by partial name
Get-DistributionGroup -Anr FSM
Search Display Name
Get-DistributionGroup -Filter "DisplayName -like '*FSM*'"
Show more details
Get-DistributionGroup -Filter "DisplayName -like '*FSM*'" |
Select Name,DisplayName,Alias,PrimarySmtpAddress
Find Any Exchange Recipient
Search mailboxes, groups, contacts, shared mailboxes, etc.
Get-Recipient -Filter "DisplayName -like '*FSM*'"
More details:
Get-Recipient -Filter "DisplayName -like '*FSM*'" |
Select Name,RecipientType,PrimarySmtpAddress
Find Shared Mailboxes
Get-Mailbox -RecipientTypeDetails SharedMailbox
Search by name:
Get-Mailbox -RecipientTypeDetails SharedMailbox |
Where-Object {$_.DisplayName -like "*FSM*"}
View Distribution Group Members
By display name:
Get-DistributionGroupMember -Identity "FSM"
By email address:
Get-DistributionGroupMember -Identity "bdl@agas.com"
Add User to Distribution List
Add-DistributionGroupMember `
-Identity "FSM" `
-Member username
Example:
Add-DistributionGroupMember `
-Identity "FSM" `
-Member jsmith
Remove User from Distribution List
Remove-DistributionGroupMember `
-Identity "FSM" `
-Member jsmith `
-Confirm:$false
Find Distribution Group AD Object
Useful when Exchange name differs from AD name.
Get-DistributionGroup "FSM" |
Format-List Name,DisplayName,Alias,DistinguishedName
Active Directory User Management
Load Active Directory Module
Import-Module ActiveDirectory
Find User
By username:
Get-ADUser username
By display name:
Get-ADUser -Filter 'Name -like "*John Smith*"'
Disable Local/AD User
Disable AD account:
Disable-ADAccount -Identity username
Verify:
Get-ADUser username -Properties Enabled
Enable Local/AD User
Enable AD account:
Enable-ADAccount -Identity username
Verify:
Get-ADUser username -Properties Enabled
Reset Password
Set-ADAccountPassword `
-Identity username `
-Reset `
-NewPassword (ConvertTo-SecureString "NewPassword123!" -AsPlainText -Force)
Force password change at next login:
Set-ADUser username -ChangePasswordAtLogon $true
Unlock AD Account
Unlock-ADAccount username
Check lockout status:
Get-ADUser username -Properties LockedOut
AD Group Membership
See User's Groups
Get-ADPrincipalGroupMembership username |
Select Name
Add User to Group
Add-ADGroupMember `
-Identity "Group Name" `
-Members username
Remove User from Group
Remove-ADGroupMember `
-Identity "Group Name" `
-Members username `
-Confirm:$false
Find Group by Name
Get-ADGroup -Filter 'Name -like "*FSM*"'
Find Group by Email Address
Get-ADGroup `
-Filter 'mail -eq "bdl@agas.com"' `
-Properties mail
Common Troubleshooting
Exchange Module Won't Load
Check if installed:
Get-Module ExchangeOnlineManagement -ListAvailable
Check execution policy:
Get-ExecutionPolicy -List
Enable script execution:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Exchange Commands Hang
Test connection:
Get-ConnectionInformation
Test response:
Get-Mailbox -ResultSize 5
Avoid pulling everything:
✅ Faster
Get-Recipient -Filter "DisplayName -like '*FSM*'"
❌ Slower
Get-Recipient -ResultSize Unlimited |
Where-Object {$_.DisplayName -like "*FSM*"}
Most Common Service Desk Commands
Connect-ExchangeOnline
Get-DistributionGroup -Anr FSM
Get-DistributionGroupMember -Identity "FSM"
Add-DistributionGroupMember -Identity "FSM" -Member username
Remove-DistributionGroupMember -Identity "FSM" -Member username
Enable-ADAccount username
Disable-ADAccount username
Unlock-ADAccount username
Get-ADPrincipalGroupMembership username
Disconnect-ExchangeOnline -Confirm:$false
Last Updated: 2026-06-24