Forum Discussion
charlie4872
Mar 02, 2021Brass Contributor
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 ...
- Mar 02, 2021You 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
farismalaeb
Mar 02, 2021Iron Contributor
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
Set-ADUser -Identity $aduser -SamAccountName "$($aduser.samaccountname)_1" -verbose
- charlie4872Mar 03, 2021Brass ContributorThank you farismalaeb. That works!