Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper parser of ManagedBy when Accounts are Entered Last, First #20

Open
cramos6520 opened this issue May 29, 2020 · 0 comments
Open

Comments

@cramos6520
Copy link

My domain uses Last, First format for the accounts. When the script parses the ManagedByValue it returns only the Last Name. The DN is a follow:

CN=Ramos, Carlos,OU=Technology_HQ,OU=Users,DC=Domain,DC=local

Script result is Ramos\

I thought I could fix with the follow code replacement but not sure why it is not wording.
Your Code: ManagedBy = (ManagedByValue.Split(',')[0]).Split('=')[1];
Replacement: ManagedBy = (ManagedByValue.Split(',OU=')[0]).Replace(',',',').Replace('CN=','');

I see your code uses a Class. Never used them so wondering it the syntax of it is not acceptable in a class.

I would think it would be advantages for your script to be able to handle such a situation. I have worked with several large companies and they all used Last, First for accounts. Only ran into one merge where the other company use first last.

Any help is appreciated.

Thanks,

Carlos

PS Beautiful work on the script. Thanks for sharing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant