Results 1 to 9 of 9

Thread: Exporting member of a particular group using csvde

  1. #1
    Graham Guest

    Exporting member of a particular group using csvde

    Hi,

    I am trying to export a list of users in a particular group so that it just
    gives me the names of the users in the group.

    I have done an export using the ldifde command but that gives the list with
    all the CN/OU/DC and the users logon information etc.

    I know it can be done using CSVE but am having trouble getting the right
    format.

    For example I want to export all users in a group named 'test users', the
    group is in an OU structure as follows:

    cn=test users,ou=users,ou=tier2,ou=tier3,dc=mycompany,dc=int

    Would appreciate any help.

    Thanks

  2. #2
    Ziad K. Chafi Guest

    RE: Exporting member of a particular group using csvde

    Hi Graham,
    It is better solved using scripting, try the following script:

    Dim strMember, strDNSDomain, strContainer
    Dim objGroup, objRootDSE
    Dim arrMemberOf

    strContainer = "cn=TypeGroupNameHere, ou=TypeOUNameHere, "

    'DO NOT CHANGE------------------------------------
    Set objRootDSE = GetObject("LDAP://RootDSE")
    strDNSDomain = objRootDSE.Get("DefaultNamingContext")

    Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    objGroup.getInfo

    arrMemberOf = objGroup.GetEx("member")
    '--------------------------------------------------

    Dim FSO, Writer
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set Writer = FSO.OpenTextFile("UsersInGroup.txt", 8, True)

    For Each strMember in arrMemberOf
    Writer.WriteLine(strMember)
    Next

    Writer.Close
    Wscript.Quit

    Just copy this script to a .vbs file, change the group and OU names, save,
    and just double click the file and you will get your list.

    Let me know...
    --
    Ziad K. Chafi
    CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT


    "Graham" wrote:

    > Hi,
    >
    > I am trying to export a list of users in a particular group so that it just
    > gives me the names of the users in the group.
    >
    > I have done an export using the ldifde command but that gives the list with
    > all the CN/OU/DC and the users logon information etc.
    >
    > I know it can be done using CSVE but am having trouble getting the right
    > format.
    >
    > For example I want to export all users in a group named 'test users', the
    > group is in an OU structure as follows:
    >
    > cn=test users,ou=users,ou=tier2,ou=tier3,dc=mycompany,dc=int
    >
    > Would appreciate any help.
    >
    > Thanks


  3. #3
    Graham Guest

    RE: Exporting member of a particular group using csvde

    Hi Ziad,

    I'll give it a go.

    Thanks for you help

    Graham

    "Ziad K. Chafi" wrote:

    > Hi Graham,
    > It is better solved using scripting, try the following script:
    >
    > Dim strMember, strDNSDomain, strContainer
    > Dim objGroup, objRootDSE
    > Dim arrMemberOf
    >
    > strContainer = "cn=TypeGroupNameHere, ou=TypeOUNameHere, "
    >
    > 'DO NOT CHANGE------------------------------------
    > Set objRootDSE = GetObject("LDAP://RootDSE")
    > strDNSDomain = objRootDSE.Get("DefaultNamingContext")
    >
    > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > objGroup.getInfo
    >
    > arrMemberOf = objGroup.GetEx("member")
    > '--------------------------------------------------
    >
    > Dim FSO, Writer
    > Set FSO = CreateObject("Scripting.FileSystemObject")
    > Set Writer = FSO.OpenTextFile("UsersInGroup.txt", 8, True)
    >
    > For Each strMember in arrMemberOf
    > Writer.WriteLine(strMember)
    > Next
    >
    > Writer.Close
    > Wscript.Quit
    >
    > Just copy this script to a .vbs file, change the group and OU names, save,
    > and just double click the file and you will get your list.
    >
    > Let me know...
    > --
    > Ziad K. Chafi
    > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    >
    >
    > "Graham" wrote:
    >
    > > Hi,
    > >
    > > I am trying to export a list of users in a particular group so that it just
    > > gives me the names of the users in the group.
    > >
    > > I have done an export using the ldifde command but that gives the list with
    > > all the CN/OU/DC and the users logon information etc.
    > >
    > > I know it can be done using CSVE but am having trouble getting the right
    > > format.
    > >
    > > For example I want to export all users in a group named 'test users', the
    > > group is in an OU structure as follows:
    > >
    > > cn=test users,ou=users,ou=tier2,ou=tier3,dc=mycompany,dc=int
    > >
    > > Would appreciate any help.
    > >
    > > Thanks


  4. #4
    Graham Guest

    RE: Exporting member of a particular group using csvde

    Hi Ziad,

    I've copied the script into a .vbs file and changed the group name and OU
    name and then tried running the script but it came up with an error in line
    11.

    Line 11 is as follows:

    Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)

    The Windows Script error is as follows:

    Line: 11
    Char: 1
    Error: 0x80005000
    Code: 80005000
    Source: (null)

    Sorry, I'm not a scripting person, so I can't really fault find on this.

    Any ideas what could be causing it.

    Many Thanks

    Graham




    "Ziad K. Chafi" wrote:

    > Hi Graham,
    > It is better solved using scripting, try the following script:
    >
    > Dim strMember, strDNSDomain, strContainer
    > Dim objGroup, objRootDSE
    > Dim arrMemberOf
    >
    > strContainer = "cn=TypeGroupNameHere, ou=TypeOUNameHere, "
    >
    > 'DO NOT CHANGE------------------------------------
    > Set objRootDSE = GetObject("LDAP://RootDSE")
    > strDNSDomain = objRootDSE.Get("DefaultNamingContext")
    >
    > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > objGroup.getInfo
    >
    > arrMemberOf = objGroup.GetEx("member")
    > '--------------------------------------------------
    >
    > Dim FSO, Writer
    > Set FSO = CreateObject("Scripting.FileSystemObject")
    > Set Writer = FSO.OpenTextFile("UsersInGroup.txt", 8, True)
    >
    > For Each strMember in arrMemberOf
    > Writer.WriteLine(strMember)
    > Next
    >
    > Writer.Close
    > Wscript.Quit
    >
    > Just copy this script to a .vbs file, change the group and OU names, save,
    > and just double click the file and you will get your list.
    >
    > Let me know...
    > --
    > Ziad K. Chafi
    > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    >
    >
    > "Graham" wrote:
    >
    > > Hi,
    > >
    > > I am trying to export a list of users in a particular group so that it just
    > > gives me the names of the users in the group.
    > >
    > > I have done an export using the ldifde command but that gives the list with
    > > all the CN/OU/DC and the users logon information etc.
    > >
    > > I know it can be done using CSVE but am having trouble getting the right
    > > format.
    > >
    > > For example I want to export all users in a group named 'test users', the
    > > group is in an OU structure as follows:
    > >
    > > cn=test users,ou=users,ou=tier2,ou=tier3,dc=mycompany,dc=int
    > >
    > > Would appreciate any help.
    > >
    > > Thanks


  5. #5
    Ziad K. Chafi Guest

    RE: Exporting member of a particular group using csvde

    Hi Graham,
    If it does not cause a security issue, can you please send me the group name
    and the ou where it is place, and if the ou is nested, please send the names
    of all parent OUs, you can use psudonames if you want no porblem.
    --
    Ziad K. Chafi
    CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT


    "Graham" wrote:

    > Hi Ziad,
    >
    > I've copied the script into a .vbs file and changed the group name and OU
    > name and then tried running the script but it came up with an error in line
    > 11.
    >
    > Line 11 is as follows:
    >
    > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    >
    > The Windows Script error is as follows:
    >
    > Line: 11
    > Char: 1
    > Error: 0x80005000
    > Code: 80005000
    > Source: (null)
    >
    > Sorry, I'm not a scripting person, so I can't really fault find on this.
    >
    > Any ideas what could be causing it.
    >
    > Many Thanks
    >
    > Graham
    >
    >
    >
    >
    > "Ziad K. Chafi" wrote:
    >
    > > Hi Graham,
    > > It is better solved using scripting, try the following script:
    > >
    > > Dim strMember, strDNSDomain, strContainer
    > > Dim objGroup, objRootDSE
    > > Dim arrMemberOf
    > >
    > > strContainer = "cn=TypeGroupNameHere, ou=TypeOUNameHere, "
    > >
    > > 'DO NOT CHANGE------------------------------------
    > > Set objRootDSE = GetObject("LDAP://RootDSE")
    > > strDNSDomain = objRootDSE.Get("DefaultNamingContext")
    > >
    > > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > > objGroup.getInfo
    > >
    > > arrMemberOf = objGroup.GetEx("member")
    > > '--------------------------------------------------
    > >
    > > Dim FSO, Writer
    > > Set FSO = CreateObject("Scripting.FileSystemObject")
    > > Set Writer = FSO.OpenTextFile("UsersInGroup.txt", 8, True)
    > >
    > > For Each strMember in arrMemberOf
    > > Writer.WriteLine(strMember)
    > > Next
    > >
    > > Writer.Close
    > > Wscript.Quit
    > >
    > > Just copy this script to a .vbs file, change the group and OU names, save,
    > > and just double click the file and you will get your list.
    > >
    > > Let me know...
    > > --
    > > Ziad K. Chafi
    > > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    > >
    > >
    > > "Graham" wrote:
    > >
    > > > Hi,
    > > >
    > > > I am trying to export a list of users in a particular group so that it just
    > > > gives me the names of the users in the group.
    > > >
    > > > I have done an export using the ldifde command but that gives the list with
    > > > all the CN/OU/DC and the users logon information etc.
    > > >
    > > > I know it can be done using CSVE but am having trouble getting the right
    > > > format.
    > > >
    > > > For example I want to export all users in a group named 'test users', the
    > > > group is in an OU structure as follows:
    > > >
    > > > cn=test users,ou=users,ou=tier2,ou=tier3,dc=mycompany,dc=int
    > > >
    > > > Would appreciate any help.
    > > >
    > > > Thanks


  6. #6
    Graham Guest

    RE: Exporting member of a particular group using csvde

    Hi Ziad,

    Initially I tried it with nested groups as follows:

    cn=test users,ou=users,ou=tier2,ou=tier3

    but I also tried it on another group example:

    cn=all birmingham, ou=dominogroups

    Thanks

    Graham



    "Ziad K. Chafi" wrote:

    > Hi Graham,
    > If it does not cause a security issue, can you please send me the group name
    > and the ou where it is place, and if the ou is nested, please send the names
    > of all parent OUs, you can use psudonames if you want no porblem.
    > --
    > Ziad K. Chafi
    > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    >
    >
    > "Graham" wrote:
    >
    > > Hi Ziad,
    > >
    > > I've copied the script into a .vbs file and changed the group name and OU
    > > name and then tried running the script but it came up with an error in line
    > > 11.
    > >
    > > Line 11 is as follows:
    > >
    > > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > >
    > > The Windows Script error is as follows:
    > >
    > > Line: 11
    > > Char: 1
    > > Error: 0x80005000
    > > Code: 80005000
    > > Source: (null)
    > >
    > > Sorry, I'm not a scripting person, so I can't really fault find on this.
    > >
    > > Any ideas what could be causing it.
    > >
    > > Many Thanks
    > >
    > > Graham
    > >
    > >
    > >
    > >
    > > "Ziad K. Chafi" wrote:
    > >
    > > > Hi Graham,
    > > > It is better solved using scripting, try the following script:
    > > >
    > > > Dim strMember, strDNSDomain, strContainer
    > > > Dim objGroup, objRootDSE
    > > > Dim arrMemberOf
    > > >
    > > > strContainer = "cn=TypeGroupNameHere, ou=TypeOUNameHere, "
    > > >
    > > > 'DO NOT CHANGE------------------------------------
    > > > Set objRootDSE = GetObject("LDAP://RootDSE")
    > > > strDNSDomain = objRootDSE.Get("DefaultNamingContext")
    > > >
    > > > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > > > objGroup.getInfo
    > > >
    > > > arrMemberOf = objGroup.GetEx("member")
    > > > '--------------------------------------------------
    > > >
    > > > Dim FSO, Writer
    > > > Set FSO = CreateObject("Scripting.FileSystemObject")
    > > > Set Writer = FSO.OpenTextFile("UsersInGroup.txt", 8, True)
    > > >
    > > > For Each strMember in arrMemberOf
    > > > Writer.WriteLine(strMember)
    > > > Next
    > > >
    > > > Writer.Close
    > > > Wscript.Quit
    > > >
    > > > Just copy this script to a .vbs file, change the group and OU names, save,
    > > > and just double click the file and you will get your list.
    > > >
    > > > Let me know...
    > > > --
    > > > Ziad K. Chafi
    > > > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    > > >
    > > >
    > > > "Graham" wrote:
    > > >
    > > > > Hi,
    > > > >
    > > > > I am trying to export a list of users in a particular group so that it just
    > > > > gives me the names of the users in the group.
    > > > >
    > > > > I have done an export using the ldifde command but that gives the list with
    > > > > all the CN/OU/DC and the users logon information etc.
    > > > >
    > > > > I know it can be done using CSVE but am having trouble getting the right
    > > > > format.
    > > > >
    > > > > For example I want to export all users in a group named 'test users', the
    > > > > group is in an OU structure as follows:
    > > > >
    > > > > cn=test users,ou=users,ou=tier2,ou=tier3,dc=mycompany,dc=int
    > > > >
    > > > > Would appreciate any help.
    > > > >
    > > > > Thanks


  7. #7
    Ziad K. Chafi Guest

    RE: Exporting member of a particular group using csvde

    OK, this should work, but make sure to place a comma before closing the
    quotation, line 4 should be somethig like this:

    strContainer = "cn=test users,ou=users,ou=tier2,ou=tier3,"

    --
    Ziad K. Chafi
    CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT


    "Graham" wrote:

    > Hi Ziad,
    >
    > Initially I tried it with nested groups as follows:
    >
    > cn=test users,ou=users,ou=tier2,ou=tier3
    >
    > but I also tried it on another group example:
    >
    > cn=all birmingham, ou=dominogroups
    >
    > Thanks
    >
    > Graham
    >
    >
    >
    > "Ziad K. Chafi" wrote:
    >
    > > Hi Graham,
    > > If it does not cause a security issue, can you please send me the group name
    > > and the ou where it is place, and if the ou is nested, please send the names
    > > of all parent OUs, you can use psudonames if you want no porblem.
    > > --
    > > Ziad K. Chafi
    > > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    > >
    > >
    > > "Graham" wrote:
    > >
    > > > Hi Ziad,
    > > >
    > > > I've copied the script into a .vbs file and changed the group name and OU
    > > > name and then tried running the script but it came up with an error in line
    > > > 11.
    > > >
    > > > Line 11 is as follows:
    > > >
    > > > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > > >
    > > > The Windows Script error is as follows:
    > > >
    > > > Line: 11
    > > > Char: 1
    > > > Error: 0x80005000
    > > > Code: 80005000
    > > > Source: (null)
    > > >
    > > > Sorry, I'm not a scripting person, so I can't really fault find on this.
    > > >
    > > > Any ideas what could be causing it.
    > > >
    > > > Many Thanks
    > > >
    > > > Graham
    > > >
    > > >
    > > >
    > > >
    > > > "Ziad K. Chafi" wrote:
    > > >
    > > > > Hi Graham,
    > > > > It is better solved using scripting, try the following script:
    > > > >
    > > > > Dim strMember, strDNSDomain, strContainer
    > > > > Dim objGroup, objRootDSE
    > > > > Dim arrMemberOf
    > > > >
    > > > > strContainer = "cn=TypeGroupNameHere, ou=TypeOUNameHere, "
    > > > >
    > > > > 'DO NOT CHANGE------------------------------------
    > > > > Set objRootDSE = GetObject("LDAP://RootDSE")
    > > > > strDNSDomain = objRootDSE.Get("DefaultNamingContext")
    > > > >
    > > > > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > > > > objGroup.getInfo
    > > > >
    > > > > arrMemberOf = objGroup.GetEx("member")
    > > > > '--------------------------------------------------
    > > > >
    > > > > Dim FSO, Writer
    > > > > Set FSO = CreateObject("Scripting.FileSystemObject")
    > > > > Set Writer = FSO.OpenTextFile("UsersInGroup.txt", 8, True)
    > > > >
    > > > > For Each strMember in arrMemberOf
    > > > > Writer.WriteLine(strMember)
    > > > > Next
    > > > >
    > > > > Writer.Close
    > > > > Wscript.Quit
    > > > >
    > > > > Just copy this script to a .vbs file, change the group and OU names, save,
    > > > > and just double click the file and you will get your list.
    > > > >
    > > > > Let me know...
    > > > > --
    > > > > Ziad K. Chafi
    > > > > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    > > > >
    > > > >
    > > > > "Graham" wrote:
    > > > >
    > > > > > Hi,
    > > > > >
    > > > > > I am trying to export a list of users in a particular group so that it just
    > > > > > gives me the names of the users in the group.
    > > > > >
    > > > > > I have done an export using the ldifde command but that gives the list with
    > > > > > all the CN/OU/DC and the users logon information etc.
    > > > > >
    > > > > > I know it can be done using CSVE but am having trouble getting the right
    > > > > > format.
    > > > > >
    > > > > > For example I want to export all users in a group named 'test users', the
    > > > > > group is in an OU structure as follows:
    > > > > >
    > > > > > cn=test users,ou=users,ou=tier2,ou=tier3,dc=mycompany,dc=int
    > > > > >
    > > > > > Would appreciate any help.
    > > > > >
    > > > > > Thanks


  8. #8
    Graham Guest

    RE: Exporting member of a particular group using csvde

    Hi Ziad,

    Yep, that worked a treat, thanks very much for all your help.

    Graham

    "Ziad K. Chafi" wrote:

    > OK, this should work, but make sure to place a comma before closing the
    > quotation, line 4 should be somethig like this:
    >
    > strContainer = "cn=test users,ou=users,ou=tier2,ou=tier3,"
    >
    > --
    > Ziad K. Chafi
    > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    >
    >
    > "Graham" wrote:
    >
    > > Hi Ziad,
    > >
    > > Initially I tried it with nested groups as follows:
    > >
    > > cn=test users,ou=users,ou=tier2,ou=tier3
    > >
    > > but I also tried it on another group example:
    > >
    > > cn=all birmingham, ou=dominogroups
    > >
    > > Thanks
    > >
    > > Graham
    > >
    > >
    > >
    > > "Ziad K. Chafi" wrote:
    > >
    > > > Hi Graham,
    > > > If it does not cause a security issue, can you please send me the group name
    > > > and the ou where it is place, and if the ou is nested, please send the names
    > > > of all parent OUs, you can use psudonames if you want no porblem.
    > > > --
    > > > Ziad K. Chafi
    > > > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    > > >
    > > >
    > > > "Graham" wrote:
    > > >
    > > > > Hi Ziad,
    > > > >
    > > > > I've copied the script into a .vbs file and changed the group name and OU
    > > > > name and then tried running the script but it came up with an error in line
    > > > > 11.
    > > > >
    > > > > Line 11 is as follows:
    > > > >
    > > > > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > > > >
    > > > > The Windows Script error is as follows:
    > > > >
    > > > > Line: 11
    > > > > Char: 1
    > > > > Error: 0x80005000
    > > > > Code: 80005000
    > > > > Source: (null)
    > > > >
    > > > > Sorry, I'm not a scripting person, so I can't really fault find on this.
    > > > >
    > > > > Any ideas what could be causing it.
    > > > >
    > > > > Many Thanks
    > > > >
    > > > > Graham
    > > > >
    > > > >
    > > > >
    > > > >
    > > > > "Ziad K. Chafi" wrote:
    > > > >
    > > > > > Hi Graham,
    > > > > > It is better solved using scripting, try the following script:
    > > > > >
    > > > > > Dim strMember, strDNSDomain, strContainer
    > > > > > Dim objGroup, objRootDSE
    > > > > > Dim arrMemberOf
    > > > > >
    > > > > > strContainer = "cn=TypeGroupNameHere, ou=TypeOUNameHere, "
    > > > > >
    > > > > > 'DO NOT CHANGE------------------------------------
    > > > > > Set objRootDSE = GetObject("LDAP://RootDSE")
    > > > > > strDNSDomain = objRootDSE.Get("DefaultNamingContext")
    > > > > >
    > > > > > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > > > > > objGroup.getInfo
    > > > > >
    > > > > > arrMemberOf = objGroup.GetEx("member")
    > > > > > '--------------------------------------------------
    > > > > >
    > > > > > Dim FSO, Writer
    > > > > > Set FSO = CreateObject("Scripting.FileSystemObject")
    > > > > > Set Writer = FSO.OpenTextFile("UsersInGroup.txt", 8, True)
    > > > > >
    > > > > > For Each strMember in arrMemberOf
    > > > > > Writer.WriteLine(strMember)
    > > > > > Next
    > > > > >
    > > > > > Writer.Close
    > > > > > Wscript.Quit
    > > > > >
    > > > > > Just copy this script to a .vbs file, change the group and OU names, save,
    > > > > > and just double click the file and you will get your list.
    > > > > >
    > > > > > Let me know...
    > > > > > --
    > > > > > Ziad K. Chafi
    > > > > > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    > > > > >
    > > > > >
    > > > > > "Graham" wrote:
    > > > > >
    > > > > > > Hi,
    > > > > > >
    > > > > > > I am trying to export a list of users in a particular group so that it just
    > > > > > > gives me the names of the users in the group.
    > > > > > >
    > > > > > > I have done an export using the ldifde command but that gives the list with
    > > > > > > all the CN/OU/DC and the users logon information etc.
    > > > > > >
    > > > > > > I know it can be done using CSVE but am having trouble getting the right
    > > > > > > format.
    > > > > > >
    > > > > > > For example I want to export all users in a group named 'test users', the
    > > > > > > group is in an OU structure as follows:
    > > > > > >
    > > > > > > cn=test users,ou=users,ou=tier2,ou=tier3,dc=mycompany,dc=int
    > > > > > >
    > > > > > > Would appreciate any help.
    > > > > > >
    > > > > > > Thanks


  9. #9
    Ziad K. Chafi Guest

    RE: Exporting member of a particular group using csvde

    Any time man, no prob. Just rate the post plz so that others can use it later.
    --
    Ziad K. Chafi
    CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT


    "Graham" wrote:

    > Hi Ziad,
    >
    > Yep, that worked a treat, thanks very much for all your help.
    >
    > Graham
    >
    > "Ziad K. Chafi" wrote:
    >
    > > OK, this should work, but make sure to place a comma before closing the
    > > quotation, line 4 should be somethig like this:
    > >
    > > strContainer = "cn=test users,ou=users,ou=tier2,ou=tier3,"
    > >
    > > --
    > > Ziad K. Chafi
    > > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    > >
    > >
    > > "Graham" wrote:
    > >
    > > > Hi Ziad,
    > > >
    > > > Initially I tried it with nested groups as follows:
    > > >
    > > > cn=test users,ou=users,ou=tier2,ou=tier3
    > > >
    > > > but I also tried it on another group example:
    > > >
    > > > cn=all birmingham, ou=dominogroups
    > > >
    > > > Thanks
    > > >
    > > > Graham
    > > >
    > > >
    > > >
    > > > "Ziad K. Chafi" wrote:
    > > >
    > > > > Hi Graham,
    > > > > If it does not cause a security issue, can you please send me the group name
    > > > > and the ou where it is place, and if the ou is nested, please send the names
    > > > > of all parent OUs, you can use psudonames if you want no porblem.
    > > > > --
    > > > > Ziad K. Chafi
    > > > > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    > > > >
    > > > >
    > > > > "Graham" wrote:
    > > > >
    > > > > > Hi Ziad,
    > > > > >
    > > > > > I've copied the script into a .vbs file and changed the group name and OU
    > > > > > name and then tried running the script but it came up with an error in line
    > > > > > 11.
    > > > > >
    > > > > > Line 11 is as follows:
    > > > > >
    > > > > > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > > > > >
    > > > > > The Windows Script error is as follows:
    > > > > >
    > > > > > Line: 11
    > > > > > Char: 1
    > > > > > Error: 0x80005000
    > > > > > Code: 80005000
    > > > > > Source: (null)
    > > > > >
    > > > > > Sorry, I'm not a scripting person, so I can't really fault find on this.
    > > > > >
    > > > > > Any ideas what could be causing it.
    > > > > >
    > > > > > Many Thanks
    > > > > >
    > > > > > Graham
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > > > "Ziad K. Chafi" wrote:
    > > > > >
    > > > > > > Hi Graham,
    > > > > > > It is better solved using scripting, try the following script:
    > > > > > >
    > > > > > > Dim strMember, strDNSDomain, strContainer
    > > > > > > Dim objGroup, objRootDSE
    > > > > > > Dim arrMemberOf
    > > > > > >
    > > > > > > strContainer = "cn=TypeGroupNameHere, ou=TypeOUNameHere, "
    > > > > > >
    > > > > > > 'DO NOT CHANGE------------------------------------
    > > > > > > Set objRootDSE = GetObject("LDAP://RootDSE")
    > > > > > > strDNSDomain = objRootDSE.Get("DefaultNamingContext")
    > > > > > >
    > > > > > > Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
    > > > > > > objGroup.getInfo
    > > > > > >
    > > > > > > arrMemberOf = objGroup.GetEx("member")
    > > > > > > '--------------------------------------------------
    > > > > > >
    > > > > > > Dim FSO, Writer
    > > > > > > Set FSO = CreateObject("Scripting.FileSystemObject")
    > > > > > > Set Writer = FSO.OpenTextFile("UsersInGroup.txt", 8, True)
    > > > > > >
    > > > > > > For Each strMember in arrMemberOf
    > > > > > > Writer.WriteLine(strMember)
    > > > > > > Next
    > > > > > >
    > > > > > > Writer.Close
    > > > > > > Wscript.Quit
    > > > > > >
    > > > > > > Just copy this script to a .vbs file, change the group and OU names, save,
    > > > > > > and just double click the file and you will get your list.
    > > > > > >
    > > > > > > Let me know...
    > > > > > > --
    > > > > > > Ziad K. Chafi
    > > > > > > CompTIA A+, CompTIA N+, MCP, MCDST, MCAS: S, MCSE: S, MCDBA, MCTS, MCT
    > > > > > >
    > > > > > >
    > > > > > > "Graham" wrote:
    > > > > > >
    > > > > > > > Hi,
    > > > > > > >
    > > > > > > > I am trying to export a list of users in a particular group so that it just
    > > > > > > > gives me the names of the users in the group.
    > > > > > > >
    > > > > > > > I have done an export using the ldifde command but that gives the list with
    > > > > > > > all the CN/OU/DC and the users logon information etc.
    > > > > > > >
    > > > > > > > I know it can be done using CSVE but am having trouble getting the right
    > > > > > > > format.
    > > > > > > >
    > > > > > > > For example I want to export all users in a group named 'test users', the
    > > > > > > > group is in an OU structure as follows:
    > > > > > > >
    > > > > > > > cn=test users,ou=users,ou=tier2,ou=tier3,dc=mycompany,dc=int
    > > > > > > >
    > > > > > > > Would appreciate any help.
    > > > > > > >
    > > > > > > > Thanks


Similar Threads

  1. Finding If User Is A Member Of A Group
    By Nadeem in forum Active Directory
    Replies: 3
    Last Post: 09-01-2014, 01:42 PM
  2. CSVDE To Obtain User account "Member Of"
    By OakwoodUser1 in forum Active Directory
    Replies: 1
    Last Post: 25-04-2011, 03:08 AM
  3. Replies: 3
    Last Post: 08-07-2010, 08:40 AM
  4. Export Group membership using script\CSVDE
    By PK in forum Windows Server Help
    Replies: 3
    Last Post: 08-10-2007, 07:46 PM
  5. Need CSVDE to dump user group memberships
    By Spin in forum Windows Server Help
    Replies: 4
    Last Post: 18-01-2006, 08:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,709,614,939.64096 seconds with 17 queries