none
Get samaccountname from distinguishedname_ powershell RRS feed

  • Question

  • I have an excel file of distinguisednames in this format:
    CN=Blow\, Joe,OU=NAME,OU=NAME,DC=NAME,DC=NAME,DC=net

    And I want to get the samaccountname of each one of the distinguisedNames.

    The name of the header of my excel file is: Users

    (I already tried a lot of scripts, but it doesn't work... I never did powershell before.)

    Friday, February 28, 2020 10:26 PM

All replies

  • The Distinguished name does not contain a SamAccountName.  You can only get that from AD.

    We cannot write a script for you.  It is your responsibility to learn PowerShell before posting in this forum.  It is for professional technicians who use PowerShell and for questions from those learning specific to an issue with understanding PS.  Fir5st you must learn PS and any technologies that you wish to script.

    There are many books on PowerShell and AD that will get you started.


    \_(ツ)_/

    Friday, February 28, 2020 11:15 PM