Using dsquery -user return special characters RRS feed

  • Question

  • Hi,

    When I use dsquery -user to get ad users, for someone, I have in return an string which contain special characters, which is not compatible with dsget.

    Sample :
    dsquery -user "mySAM" | dsget -user -email

    an user which contain "é" instead of "e" can create an error.

    Is the best solution is to use an get aduser instead of dsquery ?

    Thank you


    Monday, November 13, 2017 12:32 PM

All replies

  • Hi,

    Yes. I recommend to use get-aduser


    Monday, November 13, 2017 1:32 PM
  • The best practices would be to check all AD accounts & remove the special characters, but It's an AD with thousand accounts, so the issue can appear once again.

    I'll edit my code to use Get-ADUser instead of the other one, but the performance are greater with Dsquery than Get-ADUser...


    Monday, November 13, 2017 1:46 PM
  • Hi,

    I'm checking how the issue is going, was your issue resolved?

    And if the replies as above are helpful, we would appreciate you to mark them as answers, and if you resolve it using your own solution, please share your experience and solution here. It will be greatly helpful to others who have the same question.

    Appreciate for your feedback.

    Best Regards,
    Albert Ling

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, November 14, 2017 1:48 AM