Rover12421's Blog

The End.

添加用户的小脚本

-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-—

====js代码====
var o=new ActiveXObject( “Shell.Users” );
z=o.create(“test”) ;
z.changePassword(“123456”,“”)
z.setting(“AccountType”)=3;

 

====vbs代码====
Set o=CreateObject( “Shell.Users” )
Set z=o.create(“test”)
z.changePassword “123456”,“”
z.setting(“AccountType”)=3

AccountType 这个是设置组权限
0 Guests
1
Users
2 *Power Users *Users
3 *Administrators *Users
这里都是Localgroup
Global Group memberships *None

-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-—

 

====vbs代码====
set wsnetwork=CreateObject(“WSCRIPT.NETWORK”)
os=“WinNT://”&wsnetwork.ComputerName
Set ob=GetObject(os)
Set oe=GetObject(os&“/Administrators,group”)
Set od=ob.Create(“user”,“test”)
od.SetPassword “123456”
od.SetInfo
Set of=GetObject(os&“/test”,user)
oe.add os&“/test”

Comments