|
|
|
7i24.Com不停为您服务 在NT/2000中创建组
作者: NTScript
'来源:中文NT资源网(http://www.aboutnt.com)
'改写:沧海笑一声
'MKNTGROUP.VBS
'v1.0 4/13/2001
'原作者:Jeffery Hicks
'用法: cscript mkntgroup.vbs
On Error Resume Next
dim strServer
dim objServer
dim objGroup
dim strGroup
strServer="MYPDC" '这儿注意,要输入自己的DC(2000中)或者PDC(nt4中)名字
strGroup="TEST LOCAL GROUP" '新组的名字
Const ADS_GROUP_TYPE_GLOBAL_GROUP = &h00000002 '全局组
Const ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP = &h00000004成'域本地组
Const ADS_GROUP_TYPE_LOCAL_GROUP = &h00000004'本地组
'下面组只存在于2000纯模式中.
Const ADS_GROUP_TYPE_UNIVERSAL_GROUP = &h00000008
Const ADS_GROUP_TYPE_SECURITY_ENABLED = &h80000000
Set objServer=GetObject("WinNT://" & strServer)
Set objGroup=objServer.Create("Group",strGroup)
'substitute the appropriate constant for the group type you want to create
objGroup.Put "groupType",ADS_GROUP_TYPE_LOCAL_GROUP
'commit changes
objGroup.SetInfo
wscript.echo "New group " & strGroup & " has been created on " & strServer
set objServer=nothing
set objGroup=nothing
wscript.quit
'EOF
原作者: 沧海笑一声
|
|
|