Lý thuyết: Quản lý Groups trong Microsoft 365
Dynamic groups, naming policy và expiration policy
Các loại group trong M365
| Loại | Mô tả | Dùng cho |
|---|---|---|
| Microsoft 365 Group | Workspace cộng tác (mailbox, SharePoint, Teams, Planner) | Teams, project collaboration |
| Security Group | Kiểm soát truy cập tài nguyên, gán license | License, Intune, RBAC |
| Distribution Group | Gửi email đến nhiều người | Email list, thay thế mừng hôm nay bằng M365 Group |
| Mail-enabled Security | Security group có email address | Kiểm soát truy cập + gửi email |
| Dynamic group | Membership tự động theo rule (Entra P1) | HR-driven, location-based |
Dynamic Group Membership Rules
Dynamic groups dùng membership rule viết bằng ngôn ngữ biểu thức để tự động thêm/xóa member. Yêu cầu Entra ID P1.
# Group IT Department
(user.department -eq "Information Technology")
# Group theo vị trí và công ty
(user.city -eq "Ho Chi Minh") and (user.companyName -eq "Contoso")
# Frontline workers (theo jobTitle)
(user.jobTitle -contains "Technician") or (user.jobTitle -contains "Specialist")
# Guest users
(user.userType -eq "Guest")
Group Naming Policy
| Loại Policy | Mô tả | Ví dụ |
|---|---|---|
| Prefix-Suffix naming | Bắt buộc tiền tố/hậu tố cho tên group | GRP_<Name>_VN |
| Blocked words | Ngăn từ nhạy cảm trong tên group | CEO, Payroll, Board |
| Custom attribute | Thêm department từ user attribute | Điều phối tự động |
Group Expiration Policy
Expiration policy tự động hết hạn Microsoft 365 Groups sau X ngày. Owner nhận email nhắc gia hạn. Nếu không gia hạn, group bị xóa — có thể khôi phục trong 30 ngày.
Lab thực hành: Dynamic Groups và Naming Policy
Tạo dynamic group, cấu hình naming policy và expiration
Lab A — Tạo Dynamic Security Group
- Vào entra.microsoft.com → Groups → All groups → + New group.
- Group type: Security. Tên:
DYN-IT-Department. Membership type: Dynamic User. - Click Add dynamic query → Property:
department, Operator:Equals, Value:Information Technology. - Click Validate Rules → kiểm tra xem user nào thỏa điều kiện. Click Save → Create.
- Đợi 1–5 phút → vào group → Members — thấy user IT được thêm tự động.
Group hiển thị Membership type: Dynamic User. Thêm/xóa member tự động khi department attribute thay đổi.
Lab B — Cấu hình Group Naming Policy
- Vào entra.microsoft.com → Groups → Naming policy.
- Tab Group naming policy: click + Add prefix → chọn String → nhập
GRP_. Click + Add suffix → Attribute → chọn[Department]. - Preview: GRP_ProjectAlpha_[Department]. Click Save.
- Tab Blocked words: nhập
CEO,Board,Payroll,Confidential→ Save. - Test: tạo group mới — tên tự động thêm prefix/suffix; tên có blocked word bị từ chối.
Lab C — Cấu hình Group Expiration Policy
- Vào entra.microsoft.com → Groups → Expiration.
- Group lifetime: nhập
365ngày. Email contact: nhập email admin. - Enable expiration for: chọn Selected groups → add group
GRP_ProjectTeams. - Click Save. Owner của group sẽ nhận email 30, 15, 1 ngày trước khi hết hạn.
Get-MgGroup -GroupId "
DisplayName ExpirationDateTime
----------- ------------------
GRP_ProjectAlpha 2025-06-15T00:00:00Z
Tình huống thực tế: VinGroup và Dynamic Group Automation
Quản lý 50,000 user với dynamic groups theo bộ phận
VinGroup — Hệ thống tập đoàn 50,000 nhân viên
VinGroup với 50,000 nhân viên tại 8 công ty con (Vinmec, VinHome, VinFast, Vinhomes, Vinpearl, VinBus, VinSchool, VinAI). Mỗi công ty con có bộ phận IT riêng. Giải pháp: một tenant duy nhất với dynamic groups theo companyName + department. Naming policy: [CompanyShort]_[Department]_[Location]. Group-based licensing gán E3 cho VinFast, F3 cho VinBus frontline. Expiration 180 ngày cho project teams — giảm từ 12,000 xuống 3,200 active groups sau 6 tháng.
Cấu trúc group phân cấp
| Group | Rule mẫu | License |
|---|---|---|
| VF-Engineering-HCM | companyName eq "VinFast" and department eq "Engineering" and city eq "Ho Chi Minh" | E3 |
| VM-Clinical-HN | companyName eq "Vinmec" and department eq "Clinical" | E3 |
| VB-Driver-All | companyName eq "VinBus" and jobTitle contains "Driver" | F3 |
| VS-Teacher-All | companyName eq "VinSchool" and jobTitle contains "Teacher" | F1 |