Mandatory User Profile คือประเภท Roaming User Profile แบบ Pre-configured พิเศษ ที่สามารถเปลี่ยนแปลงได้เฉพาะ Administrator เท่านั้น ผู้ใช้ที่ได้รับ Mandatory Profile มาจัดสรร สามารถทำงานใน Windows ได้ตามปกติในช่วง Login Session แต่ ไม่มีการบันทึกการเปลี่ยนแปลงใดๆ กลับไปที่ Profile หลัง User Logoff ตอน Logon ถัดไป Mandatory Profile จะโหลดขึ้นมาใหม่โดยไม่มีการเปลี่ยนแปลง
Directory ที่มี Mandatory Profile สามารถตั้งอยู่บน Network Shared Folder และมอบหมายให้ Multiple Domain Users พร้อมกัน: เช่น ผู้ใช้ Terminal Server (RDS), Information Kiosks, หรือผู้ใช้ที่ไม่ต้องการ Personal Profile (นักเรียน นักศึกษา ผู้เยี่ยมชม) Administrator สามารถตั้งค่า Folder Redirection สำหรับ Mandatory Profiles และผู้ใช้เก็บไฟล์ส่วนตัวบน File Servers (แนะนำให้เปิด Disk Quotas ด้วย NTFS หรือ FSRM เพื่อป้องกันไม่ให้เก็บไฟล์ไม่จำเป็นในโฟลเดอร์ที่ Redirect)
ประเภทของ Mandatory User Profiles ใน Windows
มี 2 ประเภทของ Mandatory User Profiles ใน Windows:
- Normal Mandatory User Profile — Administrator เปลี่ยนชื่อไฟล์ NTuser.dat (มี User Registry Hive HKEY_CURRENT_USER) เป็น NTuser.man เมื่อใช้ Ntuser.man ระบบจะถือว่า Profile นี้ Read-only และไม่บันทึกการเปลี่ยนแปลงใดๆ หาก Mandatory Profile เก็บบน Remote Server และ Server ไม่พร้อมใช้งาน User สามารถ Logon ด้วย Cached version ของ Mandatory Profile ได้
- Super-Mandatory User Profile — เมื่อใช้ประเภทนี้ Directory ที่มี User Profile จะถูก Rename และเพิ่ม Extension .man ท้ายชื่อโฟลเดอร์ User ที่มี Profile ประเภทนี้จะ ไม่สามารถ Logon ได้ หาก Server ที่เก็บ Profile ของพวกเขาไม่พร้อมใช้งาน
บาง Scenario อนุญาตให้ใช้ Mandatory Profiles สำหรับ Local Users เช่นกัน เช่นบน Public Computers (Kiosks, Meeting Rooms ฯลฯ) แทนการใช้ UWF Filter ผู้ใช้ทุกคนทำงานใน Environment เดียวกัน และไม่มีการบันทึกการเปลี่ยนแปลงเมื่อ User Log off
ตอนนี้จะแสดงวิธีสร้าง Normal Mandatory Profile ใน Windows 10 และมอบหมายให้ User ในตัวอย่างจะพิจารณาการสร้าง Mandatory User Profile บน Local Computer (Profile จะเก็บบน Local Drive) แต่จะอธิบายการมอบหมาย Mandatory User Profile ให้ Domain Accounts ด้วย
วิธีสร้าง Mandatory User Profile ใน Windows 10
- Log on เข้าคอมพิวเตอร์ด้วยบัญชี Administrator และเปิด Local Users and Groups Console (lusrmgr.msc)
- สร้างบัญชีใหม่ เช่น ConfRoom
- ตอนนี้ต้อง Copy Default Profile ไปยัง Directory แยกที่มี Suffix เฉพาะ เนื่องจากใช้ Windows 10 1703 โฟลเดอร์นี้ต้องมี Suffix V6 เช่น ชื่อโฟลเดอร์จะเป็น
C:\ConfRoom.V6 - เปิด System Properties (SystemPropertiesAdvanced.exe)
- ในส่วน User Profiles คลิก Settings
- เลือก Default Profile คลิก Copy To
- เลือก C:\ConfRoom.V6 เป็นโฟลเดอร์ปลายทาง (หรือ Copy Profile Template ไป Network Shared Folder บน File Server ด้วย UNC Path เช่น
\\lon-fs01\profiles\ConfRoom.V6) - เลือก NT AUTHORITY\Authenticated Users ใน Permissions
เคล็ดลับ ใน Windows 10 1709 หรือ Build ใหม่กว่า มีตัวเลือก "Mandatory Profile" แยกต่างหากตอน Copy Profile Template เมื่อใช้ตัวเลือกนี้ กลุ่มผู้ใช้ที่เลือกจะได้ NTFS Read-only Permissions บนโฟลเดอร์อัตโนมัติ
วิธีมอบหมาย Mandatory Profile ให้ Users
ตอนนี้สามารถมอบหมาย Mandatory Profile ให้ User ที่ต้องการได้
หากใช้ Local Mandatory Profile ไปที่แท็บ Profile ของ User Properties ระบุ Path ไป C:\ConfRoom.v6 ในฟิลด์ Profile Path
หากตั้งค่า Roaming Mandatory User Profile ใน AD Domain ต้องระบุ UNC Path ไป Directory ที่มี Profile ใน Properties ของ Account ใน ADUC Console
จากนั้น Login เข้าระบบด้วยบัญชี User ใหม่ และทำการตั้งค่าทั้งหมดที่จำเป็น (เลือก Appearance, วาง Shortcuts, ไฟล์ที่ต้องการ, ตั้งค่า Software ฯลฯ)
เคล็ดลับ ไม่สามารถใช้ XML files ตั้งค่า Start Layout และ Taskbar สำหรับ Roaming Profiles ได้
จบ User Session และ Log on ด้วยบัญชี Administrator แล้ว Rename NTUSER.dat เป็น NTUSER.man ในโฟลเดอร์ User Profile
ลอง Logon ด้วย User ที่มี Mandatory Profile และตรวจสอบว่าหลัง Log off ไม่มีการบันทึกการเปลี่ยนแปลงใน Profile
การแก้ไข Error "The User Profile Service service failed the sign-in"
หากหลัง Logon ด้วย Mandatory User Profile ได้ Error:
The User Profile Service service failed the sign-in. User profile cannot be loaded.
และ Event ต่อไปปรากฏใน System Log:
Windows could not load your roaming profile and is attempting to log you on with your local profile. Changes to the profile will not be copied to the server when you log off. Windows could not load your profile because a server copy of the profile folder already exists that does not have the correct security. Either the current user or the Administrators group must be the owner of the folder.
ให้ตรวจสอบว่ามี Permissions ต่อไปนี้มอบหมายให้ Profile Directory (พร้อม Permission Inheritance ไปยัง Child Objects ทั้งหมด):
- ALL APPLICATION PACKAGES – Full Control (Start Menu ทำงานไม่ถูกต้องโดยไม่มีสิทธิ์นี้)
- Authenticated Users – Read and Execute
- SYSTEM – Full Control
- Administrators – Full Control
Permissions เดียวกันต้องมอบหมายให้ User Registry Hive โดย Load ntuser.dat profile file ด้วย File → Load Hive ใน regedit.exe
เมื่อใช้ Roaming Profiles เพื่อให้ Start Menu แสดงผลถูกต้องบนอุปกรณ์ทุกเครื่อง ต้องตั้งค่า REG_DWORD Key ชื่อ SpecialRoamingOverrideAllowed ค่า 1 ใน HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\
หมายเหตุ หากต้องการแก้ไข Mandatory Profile ให้ Rename ntuser.man กลับเป็น ntuser.dat ตั้งค่า Environment ภายใต้ User Account แล้ว Rename ไฟล์กลับ
เมื่อใช้ Mandatory Profile บน RDS Servers สามารถใช้ Group Policies ต่อไปนี้ ซึ่งสามารถระบุ Path ไป Profile Directory และเปิดใช้งาน Mandatory Profiles GPO Section: Computer Configuration → Policies → Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Profiles
- Use mandatory profiles on the RD Session Host server = Enabled
- Set path for Remote Desktop Services Roaming User Profile = Enabled + ระบุ UNC Path
โปรดทราบ หากตัดสินใจใช้ Folder Redirection พร้อม Mandatory Profile ไม่แนะนำให้ Redirect AppData (Roaming) Folder