Richard
Thu Sep 06 10:02:45 PDT 2007
Carlos wrote:
>I have a list of existing users in a CSV file, does anyone have a script
>that
> I can use to add those users to an existing security group?
I have an example VBScript program that adds users to a designated group
from a text file. The program is linked here:
http://www.rlmueller.net/Add%20Users%20to%20Group%202.htm
The text file must have user Distinguished Names, one per line. The program
expects you to pass the NetBIOS name of the group as a parameter (plus the
name of the file). It uses the NameTranslate object to convert the NetBIOS
name of the domain to the Distinguished Name.
The program could be revised to accept the NT names (sAMAccountNames, also
called the "pre-Windows 2000 logon name") for users in the text file. The
same NameTranslate object would be used to convert each name to
Distinguished Name. Maybe I should add another version of this program to my
web site that does that.
Comma delimited files are difficult to handle in VBScript. I have an example
linked here that uses a function. This function could be incorporated in a
program to add users to a group.
http://www.rlmueller.net/ReadCSV.htm
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab -
http://www.rlmueller.net
--