dsquery group -name "组名" | dsget group -members | dsget user -samid -dn >>c:\SUNUSER.csv
把组名改成你想导出的组的名字作者: rubar_luo 时间: 2010-5-10 09:30
谢谢,按你的方法已解决, 不过我还有问题向你请教,
第一,.在邮件服务器中我用不了net group命令。
C:\Documents and Settings\rubarluo>net group
This command can be used only on a Windows Domain Controller.
More help is available by typing NET HELPMSG 3515.
我右键点击“group",选择"Export List"导出来的,
2.用你提供dsquery group -name 导出了心仪的群组成员,但是只是英文帐号,如何让这些帐号跟通讯录的中文名一一对应呢,中文名设置在account->用户名->organization->title的位置上。我现在都一个一个搜出来对应的。有方法吗?再次感谢!作者: robcao 时间: 2010-5-10 11:54
1.你的exchange是装在域控制器上的,而域控是没有“本地用户和组”的,所以运行不了net group命令
2.。等钉子帮你吧作者: 想Fei的猪 时间: 2010-5-10 14:44
on error resume next
objGroupName=InputBox("Please enter the group name : ")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(objGroupName & ".txt")
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select adspath from 'LDAP://DC=Test,DC=com'Where objectClass='group' and name='" & objGroupName & "'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
GroupPATH = objRecordSet.Fields("adsPath").Value
set objGroup = GetObject(GroupPATH)
If isarray(objGroup.member) = True Then
For Each strUser in objGroup.member
Set objUser = GetObject("LDAP://" & strUser)
objFile.WriteLine objUser.Title
Next
Else
Set objUser = GetObject("LDAP://" & objGroup.member)
objFile.WriteLine objUser.Title
End If