ผมเคยเจอเหตุการณ์หนึ่งที่ลูกค้าต้องการ Block การใช้งาน Office 365 ให้กับพนักงานที่พึ่งลาออกไป ทั้งแผนก!!!!! หรือสงสัยว่าพนักงานคนนี้ มีความชอบมาพากล โดยปกติเราสามารถใช้ GUI ทำได้ครับ แต่ทำทีละคน
การ Block Access บริการทุกบริการยังมีอยู่ครับ แต่ User ไม่สามารถเข้าใช้งานได้ ดังนั้นไม่ต้องกลัวว่าอีเมลจะหายไป

วิธีการ block รายบุคคล
Set-MsolUser -UserPrincipalName user1@mvpskill.com -BlockCredential $true
วิธีการ un-block รายบุคคล
Set-MsolUser -UserPrincipalName user1@mvpskill.com -BlockCredential $false
วิธีการ block หลายๆคน
1. ให้สร้างไฟล์ Text แล้วกรอกอีเมล และทำการบันทึก
[email protected]
[email protected]
[email protected]
2. พิมพ์คำสั่งนี้
Get-Content "C:\My Documents\Accounts.txt" | Set-MsolUser -UserPrincipalName $_.UserPrincipalName -BlockCredential $true
3. วิธีการ un-block หลายๆคนทีเดียว
Get-Content "C:\My Documents\Accounts.txt" | Set-MsolUser -UserPrincipalName $_.UserPrincipalName -BlockCredential $false










![[Tips] แก้ปัญหา Font ตัวเล็กใน Edge แบบถาวร](https://www.mvpskill.com/wp-content/uploads/2018/05/windows10_rez2.jpg)














![[Review] การสอบ Microsoft Certification จากที่บ้าน](https://www.mvpskill.com/wp-content/uploads/2020/04/cert3-218x150.jpg)

![[สรุปงาน] งานสัมนา Power Platform ว่าด้วยการนำ Power BI / Power Apps / Power Automate (Microsoft Flow) ไปใช้แก้ปัญหาในที่ทำงาน](https://www.mvpskill.com/wp-content/uploads/2020/01/Power-Platform-Website-218x150.png)







