Add hàng loạt member vào Distribution group trên MS 365

Owner tự quản lý member theo link:

Exchange admin center 

Add hàng loạt member vào Distribution List group trên MS 365

Áp dụng cho cả mail-enabled security group (cloud only) - không sử dụng được cho group sync từ AD on-premise lên

Nâng cấp PowerShell lên bản mới ( PowerShell 7)nếu vẫn đang ở 5.1: mở PS, chạy lệnh:

winget install --id Microsoft.PowerShell

Nếu làm việc nhiều dòng, đổi sang Visual Studio Code

winget install --id Microsoft.VisualStudioCode

Cài xong vào Extension => tìm PowerShell và cài thêm

 

Tiến hành add member: 

import module cần dùng 

Import-Module ExchangeOnlineManagement

Connect bằng tài khoản admin: sẽ bật lên cửa sổ trình duyệt để xác thực:

Connect-ExchangeOnline -UserPrincipalName admin@domain.com

Chạy lệnh add member:

Add-DistributionGroupMember -Identity "group-mail@domain.com" -Member "no-reply@domain.com" 

 

No comments:

Post a Comment

MS 365 chạm giới hạn số lượng xóa user cùng lúc

Để tránh xóa nhầm, trên hệ thống AAD Connect sẽ có giới hạn số lượng user xóa trong cùng 1 lượt:  https://learn.microsoft.com/en-us/entra/id...