Managing Office 365 via PowerShell CLI needs to have proper access rights or privileges.
Connect-exchangeonline -userprincipalname
email-admin@domain.com
PowerShell for Office 365 is very handy. Below are just a few examples that might save some time and focus on other important task, or just simply enjoying more coffee time.
Get or list aliases of a mailbox, email account or group
mailboxes.
Get-UnifiedGroup -Identity "Name of the Mailbox" |
Select-Object DisplayName,@{Name=”EmailAddresses”;Expression={$_.EmailAddresses
|Where-Object {$_ -LIKE “SMTP:*”}}} | ft -wrap
List the Primary Email of a group's mailbox using the group name.
Get-UnifiedGroup -Identity "Name of the Mailbox" | Select-Object DisplayName,PrimarySmtpAddress
Change group primary email.
Set-Unifiedgroup -identity "Group Name to change
email" -primarysmtpaddress new-email@of-the-group.com
Create a new group with the email address.
Access Type can be set, value can be Public or Private.
New-Unifiedgroup -DisplayName "Group - Name" -EmailAddresses "emai-of-the-group@domain.com" -AccessType Public
Changing email group access type from Public to Private.
Set-UnifiedGroup -Identity "Group - Name"
-AccessType Private
Set or create an alias of the group.
Set-UnifiedGroup -Identity "Group - Name"
-EmailAddresses: @{Add ="new-alias-of-the-group@domain.com"}
Add an email to the group.
Add-UnifiedGroupLinks –Identity
"email-group@domain.com" –LinkType "Members" –Links "email-account-to-be-added@domain.com"
Above command adds a single email to the group.
To add multiple emails use this small PowerShell snippet.
#======================
Import-csv
"c:\tmp\emails-group.csv" | foreach-object {
$email = $_.members
Write-Output $added_email
#========================
emails-group.csv need to follow this format.
1st Row value should be the literal text--> members
2nd row onwards are the email accounts to b added to the
group
Till next time. Stay safe! and keep things up!
Do ASAP, Always Say A Prayer...
================================
Free Android Apps:
Click links below to find out more:
Excel Keyboard guide:
https://play.google.com/store/apps/details?id=chrisjoms.myexcelapplicationguide
Heaven's Dew Fall Prayer app for Android :
https://play.google.com/store/apps/details?id=soulrefresh.beautiful.prayer
Catholic Rosary Guide for Android:
Pray the Rosary every day, countless blessings will be showered upon your life if you recite the Rosary faithfully.
https://play.google.com/store/apps/details?id=com.myrosaryapp
Divine Mercy Chaplet Guide (A Powerful prayer) BFF = Be Filled Faith:
https://play.google.com/store/apps/details?id=com.dmercyapp
Comments
Post a Comment