Announcement

Collapse
No announcement yet.

DSGET Problems exporting members from a group

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • DSGET Problems exporting members from a group

    Well I am trying to export all members from my internet users group. I have used DSGET and the command runs but at the end of it running I get an error that states. Server returned a referral, I thought DSGET chased referrals? At any rate I need to know how to do this.

    Here is the command I ran

    Dsget group "CN=Internet Users,OU=Arrow Uniform,OU=Distribution Groups,DC=arrow,DC=com" -members -expand

    I also tried


    Dsget group "CN=Internet Users,OU=Arrow Uniform,OU=Distribution Groups,DC=arrow,DC=com" -members > internetusers.txt

    Both of them return the server referral error.

    Can someone tell me what I am doing wrong?

    WIN2K3 Domain ( only one domain )

    Also is there another way to do this? I searched the forum and couldn't find anything if this is a repost I apologize in advance.

    Thanks for your help

  • #2
    Re: DSGET Problems exporting members from a group

    The error is telling that the domainDN you use in the command (DC=arrow,DC=com) cannot be found.

    \Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: DSGET Problems exporting members from a group

      Interesting the domain name is actually arrowuniform.com

      However if I put DC=ARROWUNIFORM,DC=COM

      I get an error instantly without referral stating Directory object not found. I wonder if there is another problem that I am unaware of.

      Comment


      • #4
        Re: DSGET Problems exporting members from a group

        Do you run the command from the DC? If not, then do so.

        Test the DN with this script "OpenInADUC.vbs':
        http://forums.petri.com/showpost.php...62&postcount=5

        After starting the script asks for input.
        Start with just the domainDN.
        Don't use quotes when entering the DN.
        If that runs succesfull , add the first OU to it - and so on.

        Could it be that one of the the real OU or CN names contain a comma or a backslash in its name?

        \Rems

        This posting is provided "AS IS" with no warranties, and confers no rights.

        __________________

        ** Remember to give credit where credit's due **
        and leave Reputation Points for meaningful posts

        Comment


        • #5
          Re: DSGET Problems exporting members from a group

          Or, try this script.
          (save as *vbs file on the DC, then dubbelclick)

          It asks you for the AD- Group's name (domain\group)
          The script will translate the netbios Domainname and the name of the groupobject to a DN.

          Code:
          Const ADS_NAME_INITTYPE_GC = 3  '<--(needs clear access to the Global Catalog!)
          Const ADS_NAME_TYPE_NT4    = 3
          Const ADS_NAME_TYPE_1779   = 1
          
          Set WshNetwork = WScript.CreateObject("WScript.Network")
          NbDomain = WshNetwork.UserDomain
          
          Do until Instr(UCASE(sNTGroup), "\")
           sNTGroup = InputBox("Enter the Groupname" & VBNewLine & VBNewLine _
                   & "notation:" & vbNewLine & "NetBios-Domainname\Groupname" & vbNewLine & "(backslash as separator)", _
                   "Get Members",NbDomain & "\Internet Users")
           If sNTGroup = Cancel  Then  WScript.Quit
          Loop
          
          strNTName = split(sNTGroup,"\")(1)
          strNetBIOSDomain = split(sNTGroup,"\")(0)
          
          Set objTrans = CreateObject("NameTranslate")
          objTrans.Init ADS_NAME_INITTYPE_GC, ""
          objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain & "\" & strNTName
          
          ' distinguishedname:
          strItemDN = Trim(Replace(objTrans.Get(ADS_NAME_TYPE_1779), "/", "\/"))
          
          With WScript.CreateObject("WScript.Shell")
            .Run "%Comspec% /k dsget.exe group """ & strItemDN & """ -members",1,False
          End With
          
          Set objGroup = GetObject _
            ("LDAP://" & strItemDN)
          objGroup.GetInfo
           
          arrMemberOf = objGroup.GetEx("member")
          List = "Members: " & strItemDN & vbNewLine & vbNewLine 
          For Each strMember in arrMemberOf
            List = List & strMember & VBNewLine
          Next
          
          Wscript.echo List
          Wscript.echo "Group ", chr(34) & strItemDN & chr(34)
          This script ends with two outputs.
          1. the script use a "DSGet.exe Group"-command line
          -and-
          2. it also use a ADSI Script to get the members.
          See what works best in your environment.

          \Rems
          Last edited by Rems; 21st November 2007, 00:26.

          This posting is provided "AS IS" with no warranties, and confers no rights.

          __________________

          ** Remember to give credit where credit's due **
          and leave Reputation Points for meaningful posts

          Comment


          • #6
            Re: DSGET Problems exporting members from a group

            Was this AD renamed in the past ?
            Did it have trusts that currently do not work ?
            Does the command succeed without the "-expand" switch ?
            Guy Teverovsky
            "Smith & Wesson - the original point and click interface"

            Comment

            Working...
            X