Re: export to a AD Distributed group to a text



WoOw physicalDeliveryOfficeName is equeal to office attribute ,what about
City attribute ?

and where can i found a list of all those attributes




"Richard Mueller" wrote:

Ammar wrote:

I have a client who want me to export a distributed gruop members in my
Active directory to a text file ,
Thet want the members of this group to be listed with their office
attribute .
can this be done and how

Hi,

Using csvde you can use a command similar to the following (watch line
wrapping, this is all one line):

csvde -f report.txt -r (memberOf="cn=My
Group,ou=Sales,dc=MyDomain,dc=com") -l
sAMAccountName,physicalDeliveryOfficeName

You must specify the full Distinguished Name of the group for the memberOf
attribute. The sAMAccountName attribute is the NT name of the member (also
called the "pre-Windows 2000 logon name"). The LDAP display name of the
"Office" attribute is physicalDeliveryOfficeName.

In VBScript, you can bind to the group and use the Members method of the
group object to enumerate all members. For each member, you would output the
values of the attributes desired. For example:
=====================
Option Explicit
Dim objGroup, objMember

Set objGroup = GetObject("LDAP://cn=My Group,ou=Sales,dc=MyDomain,dc=com")
For Each objMember In objGroup.Members
Wscript.Echo objMember.sAMAccountName & ", " &
objMember.physicalDeliveryOfficeName
Next
=====================
If you run this at a command prompt with the cscript host, the output can be
re-directed to a text file. For example, if the above VBScript program is in
a file called ListGroup.vbs, use the following command to create a report
called output.txt:

cscript //nologo ListGroup.vbs > output.txt

The "//nologo" option suppresses logo information. The above assumes you are
currently in the directory where the file ListGroup.vbs is located -
otherwise you must specify the full path to the file.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net



.



Relevant Pages

  • Re: export to a AD Distributed group to a text
    ... Active directory to a text file, ... you can bind to the group and use the Members method of the ... If you run this at a command prompt with the cscript host, ...
    (microsoft.public.windows.server.active_directory)
  • Re: Command Button "Find"
    ... "Search" on the bottom of each form where they can find members there. ... The popup form is not. ... Allen Browne - Microsoft MVP. ... has command buttons on it that goes to my forms/reports. ...
    (microsoft.public.access.forms)
  • Re: GUI for access 2002
    ... 1.I execute a command button that loads the form with data from a members ...
    (microsoft.public.access.gettingstarted)
  • Re: Export Member from a Security Group
    ... each DN will be in it's own cell. ... Microsoft MVP Scripting and ADSI ... all the members in one cell with all of the information I don't need like ... You can use the command line utility csvde, ...
    (microsoft.public.win2000.active_directory)
  • Re: dsquery
    ... with adfind /?, or at this link: ... sAMAccountName, member ... The command gave me all the mail enabled groups ... but I also need a list of the members of each group. ...
    (microsoft.public.windows.server.active_directory)

Loading