Results 1 to 3 of 3

Thread: User dsquery to obtain lanid, name for all users in the domain.

  1. #1
    Join Date
    Dec 2005
    Posts
    102

    User dsquery to obtain lanid, name for all users in the domain.

    Can anyone tell me whether this is the proper command to dump out all users lan id and name information in the domain?

    dsquery user -name "*" -limit 0 | dsget user -samid -ln -fn -display

    But it doesnt seem to have the 2 lan ids and has everyone else that I checked. It will also not exclude the account that is running the command does it? Can anyone please help. Thanks.

  2. #2
    Join Date
    Jan 2006
    Posts
    278

    Re: User dsquery to obtain lanid, name for all users in the domain.

    I think that the syntax is proper. But still there is no need to enclose the * in the quotes, it will not harm anything. I find that -
    dsquery user -name * -limit 0 - returns the DN of all users in the domain. You need to check that in our domain. But, the dsget command chokes on some DN's with unusual but valid characters in the Common Name. It will give an error, so I dont think it is the issue.

  3. #3
    Join Date
    Aug 2005
    Posts
    822

    Re: User dsquery to obtain lanid, name for all users in the domain.

    I think that you can use the below command, without the need of the -name parameter:

    dsquery user -limit 0 | dsget user -samid -ln -fn -display

    I can also confirm that if any user has the quote character in their common name the command fails. At that time, you can redirect the DN's to a text file, then find the DN's with embedded quotes and excape them with the backlash escape character.

Similar Threads

  1. DSQuery list user for entire forest
    By kennyja in forum Active Directory
    Replies: 3
    Last Post: 03-01-2014, 03:52 PM
  2. Replies: 1
    Last Post: 09-06-2012, 07:03 PM
  3. DSQUERY: list users created after a specific date
    By AndieB in forum Active Directory
    Replies: 2
    Last Post: 27-11-2008, 01:05 AM
  4. dsquery for users last logon time???
    By Delil in forum Active Directory
    Replies: 4
    Last Post: 13-07-2005, 12:06 AM
  5. DSQUERY to find user not logged in for 120 days
    By Vera Noest in forum Active Directory
    Replies: 2
    Last Post: 26-01-2005, 06:57 AM

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,711,665,566.16455 seconds with 18 queries