Hello
Thank you for your question and reaching out. I can understand you are having issues related to character limit in AD
If you are using server 2012 R2 you can only set the display name to 20 char however the login name can be up to 64 char (I think) using "-UserPrincipalName"
You can have a Name that exceeds 20 characters, but not a sAMAccountName.
Reference :
https://learn.microsoft.com/en-us/windows/win32/adschema/a-samaccountname?redirectedfrom=MSDN
-------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--