Paul
Wed May 07 05:36:32 PDT 2008
If you go to the script center from the link I provided you should be able
to find examples on reading a text file.
--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4
http://www.pbbergs.com
Please no e-mails, any questions should be posted in the NewsGroup
This posting is provided "AS IS" with no warranties, and confers no rights.
"Phil" <Phil@discussions.microsoft.com> wrote in message
news:337995B3-1701-4368-903F-1E28A5271DD2@microsoft.com...
> Thanks Paul.
>
> In the ## Add user to the group ## section, how do I get it to read the
> list
> of users to be added to the group in from a .txt or .csv file etc.
>
> Phil
>
>
> "Paul Bergson [MVP-DS]" wrote:
>
>> ## Clear the group ##
>>
>> Set objGroup = GetObject
>> ("LDAP://cn=GroupName,ou=SomeOU,dc=domainName,dc=com")
>>
>> objGroup.PutEx ADS_PROPERTY_CLEAR, "member", 0
>>
>> objGroup.SetInfo
>>
>>
>>
>> ## Add user to the group ##
>>
>> Set objGroup = GetObject _
>>
>> ("LDAP://cn=GroupName,ou=SomeOU,dc=domainName,dc=com")
>>
>> objGroup.PutEx ADS_PROPERTY_APPEND, "member", Array(DistinguishedName)
>>
>> objGroup.SetInfo
>>
>>
>> This should all be available at:
>>
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true
>>
>> --
>> Paul Bergson
>> MVP - Directory Services
>> MCTS, MCT, MCSE, MCSA, Security+, BS CSci
>> 2008, 2003, 2000 (Early Achiever), NT4
>>
>>
http://www.pbbergs.com
>>
>> Please no e-mails, any questions should be posted in the NewsGroup
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Phil" <Phil@discussions.microsoft.com> wrote in message
>> news:35EB0503-0310-48C8-8317-119080743636@microsoft.com...
>> > 2003 AD, Native forest and Domain.
>> > XP SP2 clients.
>> >
>> > I need to script up a way of clearing all current members for an AD
>> > Distribution Group and then adding back in all the members from a .txt
>> > or
>> > .csv file.
>> >
>> > The script needs to be able to be run by users that have permissions to
>> > the
>> > AD group object.
>> >
>> > Any ideas?
>> >
>> >
>>
>>
>>