วิธีการเซ็ต Password ไม่ให้หมดอายุด้วย PowerShell
วิธีการเซ็ต Password ไม่ให้หมดอายุด้วย PowerShell

วิธีการเซ็ต Password ไม่ให้หมดอายุด้วย PowerShell
ขั้นตอนการดำเนินการ
1.คลิกที่แว่นขยาย
2.พิมพ์ ise > ปรากฏ Windows PowerShell ISE
3.คลิกขวา Run as administrator
4.คำสั่ง Powershell สำหรับ ตั้งค่า Password ให้หมดอายุ
Get-WmiObject -Class Win32_UserAccount -Filter "name = 'Pantum'" | Set-WmiInstance -Argument @{PasswordExpires = 1}
ทำการครอบคำสั่งบรรทัดที่ 1 ทั้งบรรทัด
5.คลิกปุ่ม Run Selection (F8)
6.ใช้คำสั่ง CLI พิมพ์ net user localaccount กด Enter
7.สังเกตบรรทัด Password expires
8.ทำการครอบคำสั่งบรรทัดที่ 3 ทั้งบรรทัด
Get-WmiObject -Class Win32_UserAccount -Filter "name = 'Pantum'" | Set-WmiInstance -Argument @{PasswordExpires = 0}
9.คลิกปุ่ม Run Selection (F8)
10.ใช้คำสั่ง CLI พิมพ์ net user localaccount กด Enter
11.สังเกตบรรทัด Password expires > Never
What's Your Reaction?






