このブログを検索

2012/06/06

DOSコマンドでアカウントを作成・削除など

windows GUIからアカウントを作成するのが面倒だったので以下のコマンドを使用した.
アカウント作成
net user [account] [password] /fullname:"[full name]" /comment:"[comment]" /passwordchg:no /add 
アカウント削除
net user [account] /delete
アカウント停止
net user [account] /active:no 
グループに追加
net localgroup "[group name]" [account] /add 
グループから削除
net localgroup "[group name]" [account] /delete 
パスワードを無期限
wmic useraccount where "Name='[account]'" set PasswordExpires=FALSE 
アカウントパスワードの変更
net user [account] [new password] 
グループの作成
net localgroup "[group name]" /add /comment:"[comment]"
dosとwmicを混合して使用する場合は、wmicを末尾にもってきた方がコマンドの失敗がなくて良い.



0 件のコメント:

コメントを投稿