Forum Discussion

charlie4872's avatar
charlie4872
Brass Contributor
Mar 02, 2021
Solved

Adding to end of AD user Samaccountname

Hello I am trying to add a "1_" to the END of a list of Samaccountnames in AD. I found a script that will add it to the BEGINNING of the username but not the end. I have tried moving the 1_$ to then ...
  • farismalaeb's avatar
    Mar 02, 2021
    You dont need to move the 1_$, just move the 1_ and make the code like this
    Set-ADUser -Identity $aduser -SamAccountName "$($aduser.samaccountname)_1" -verbose

Resources