Results 1 to 2 of 2

Thread: using Dsquery and DSGET

  1. #1
    Join Date
    Jul 2011
    Posts
    1

    using Dsquery and DSGET

    Hi,

    I'm trying to out put only the members full name from specified group.

    I used this command but no matter what string that I use is not producing that. It only produces the name of the person but with its AD Object location as well

    dsquery group -name "MyGroup" | DSGET group -members >"MyGroup".txt
    This produces the names of the members with including:

    (ie..

    CN=John Smith, OU=Staff,OU=Sales-Calgary,OU=Sales,OU=Alberta,OU=ABC Company,DC=Domain,DC=local
    )

    Can you please assist me what do I have to include in that command in order to get just
    John Smith
    without those paths?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Posts
    4,221

    Re: using Dsquery and DSGET

    The DSQuery command finds AD objects and DSGet command gets more details. To find a user in active directory:

    Dsquery user -name (username or partial name with wildcards)

    For example:

    The result of the command:

    dsquery user -name dwayne*

    Will display the following:

    “CN=Dwayne La Rose,OU=Tech,OU=Some other OU,DC=SomeDomain,DC=com”

    You can then pipe that dquery command into a DSGet command to get more details about objects.

    Command:

    dsquery user -name dwayne*|dsget user -display -email -tel

    Results:

    Dispaly Tel

Similar Threads

  1. Replies: 1
    Last Post: 09-06-2012, 07:03 PM
  2. DSGET - where am I going wrong
    By Jingle Man in forum Windows Server Help
    Replies: 4
    Last Post: 06-05-2011, 01:27 AM
  3. Replies: 2
    Last Post: 28-02-2010, 08:30 PM
  4. dsquery and dsget
    By aconti in forum Active Directory
    Replies: 1
    Last Post: 01-11-2009, 04:09 PM
  5. List of Last Logon Time with dsget/dsquery
    By Viensterrr in forum Active Directory
    Replies: 1
    Last Post: 17-09-2008, 05:36 PM

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,714,297,395.99432 seconds with 17 queries