การเปลี่ยนยูสเซอร์ (บัญชีผู้ใช้งาน) บนวินโดว์สด้วยคอมมานด์ไลน์

การเพิ่มลบผู้ใช้ด้วย UI ของวินโดวส์อาจทำได้ลำบาก ถ้าต้องเพิ่มทีละมากๆ หรือทำผ่านการรีโมท การใช้ผ่านคอมมานด์ไลน์จะสะดวกกว่ามาก โดย Windows ได้มีคำสั่งไว้ให้คือ net user โดยคำสั่งนี้จะรองรับตั้งแต่เวอร์ชัน 2000, WindowsXP, 2003 ขึ้นไป
การเพิ่มยูสเซอร์ใหม่บนเครื่องโลคอล
net user username password /ADD
ตัวอย่าง: การเพิ่มบัญชีผู้ใช้ใหม่ ด้วยชือล็อกอิน usera และรหัสผ่านคือ abc123
net user usera abc123 /ADD

การลบผู้ใช้ 
net user usera /DEL
เพิ่มเติมอีกนิด สามารถกำหนดชื่อเต็มของยูสเซอร์ที่สร้างได้ ด้วยออปชัน /FULLNAME:"UserName"
net user username password /ADD /FULLNAME:"User_Fullname"
การกำหนดให้เปลี่ยนรหัสผ่านเมื่อล็อกอิน หรือไม่ต้องเปลี่ยนด้วย /PASSWORDCHG:Yes/NO
net user username password /ADD /PASSWORDCHG:Yes/NO
การเรียกดูข้อมูลของยูสเซอร์



Net user username
C:\>net user techblogger
User name                    techblogger
Full Name
Comment
User's comment
Country code                 000 (System Default)
Account active               Yes
Account expires              Never

Password last set            4/21/2011 10:10 PM
Password expires             8/19/2011 10:10 PM
Password changeable          4/21/2011 10:10 PM
Password required            Yes
User may change password     Yes

Workstations allowed         All
Logon script
User profile
Home directory
Last logon                   Never

Logon hours allowed          All

Local Group Memberships      *Users
Global Group memberships     *None
The command completed successfully.
ปัญหา   ท่านจะได้รับข้อความต่อไปนี้ ถ้ายูสเซอร์ที่ใช้งานอยู่ไม่มีสิทธิที่จะเพิ่มผู้ใช้้ 
C:\>net user usera /add
System error 5 has occurred.
Access is denied.
C:\> 
แก้โดยก่อนรันคอมมานด์ไลน์ให้ คลิ๊กขวา เลือก Run as administrator

ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้

วิธีการลบ printer ที่ remove device ปรกติไม่ออก

วิธีการแก้ไข logon แล้วแจ้งว่า The User Profile Service service failed the logon. User profile cannot be loaded.

ลบประวัติการรีโมทจาก Remote Desktop Connection