Re: export to a AD Distributed group to a text



dear ,
when i use the command CSVDE to export members of goup in AD , i face a
problem when doing this with group names contacining many spaces like ( sales
in my-company) group

can you help in this

"Richard Mueller" wrote:

Hi,

I have spreadsheets that document attributes at this link:

http://www.rlmueller.net/UserAttributes.htm

The first spread*** documents most attributes corresponding to the fields
in ADUC. City is "l" (short for Locality-Name).

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
"Ammar" <Ammar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FB2CB645-E19E-4DDD-9535-5EEF005B127B@xxxxxxxxxxxxxxxx
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






.