Home All Groups Group Topic Archive Search About

exporting * importing users into groups

Author
10 Dec 2008 11:13 AM
pljdoyle
Hi,
I am wanting to export a list of usernames from an AD group & then import them back into another group.  I believe it is possible to do this using the csvde command, but Im not sure of the syntax.  Would some one be kind enough to explain what syntax I would use for both of these tasks please?

Thanks -- pljdoyle ------------------------------------------------------------------------ pljdoyle's Profile: http://forums.techarena.in/members/pljdoyle.htm View this thread: http://forums.techarena.in/server-scripting/1084621.htmhttp://forums.techarena.in

Author
11 Dec 2008 1:55 PM
Richard Mueller [MVP]
pljdoyle wrote:

> I am wanting to export a list of usernames from an AD group & then
> import them back into another group.  I believe it is possible to do
> this using the csvde command, but Im not sure of the syntax.  Would some
> one be kind enough to explain what syntax I would use for both of these
> tasks please?
>
> Thanks

A VBScript solution would be similar to:
===========
' Bind to "source" group.
Set objGroup1 = GetObject("LDAP://cn=Source
Group,ou=West,dc=MyDomain,dc=com")

' Bind to "target" group.
Set objGroup2 = GetObject("LDAP://cn=Target
Group,ou=West,dc=MyDomain,dc=com")

' Enumerate direct members of "source" group.
For Each objMember In objGroup1.Members
    ' Check if this object is already a member of "target" group.
    If (objGroup2.IsMember(objMember.AdsPath) = False) Then
        ' Make a member of "target" group.
        objGroup2.Add(objMember.AdsPath)
    Then
Next

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
Author
11 Dec 2008 7:37 PM
Wiseman82
You could do this with my Bulk Password Control/Bulk AD Users tool:

http://www.wisesoft.co.uk/Products/PasswordControl/BulkPasswordControl/

Just select the users from the old group and then use the bulk modify dialog
to append the new group.

Hope this helps,

David
http://www.wisesoft.co.uk
(My personal website and a free resource for IT Professionals)

PS

A new version of the application called "Bulk AD Users" is available as beta
for testing purposes:
http://www.wisesoft.co.uk/articles/bulk_ad_users_beta_testing.aspx


Show quoteHide quote
"pljdoyle" <pljdoyle.3k8yxa@DoNotSpam.com> wrote in message
news:pljdoyle.3k8yxa@DoNotSpam.com...
>
> Hi,
> I am wanting to export a list of usernames from an AD group & then
> import them back into another group.  I believe it is possible to do
> this using the csvde command, but Im not sure of the syntax.  Would some
> one be kind enough to explain what syntax I would use for both of these
> tasks please?
>
> Thanks
>
>
> --
> pljdoyle
> ------------------------------------------------------------------------
> pljdoyle's Profile: http://forums.techarena.in/members/pljdoyle.htm
> View this thread: http://forums.techarena.in/server-scripting/1084621.htm
>
> http://forums.techarena.in
>