rtrouton / rtrouton_scripts

Scripts to share
MIT License
1.3k stars 491 forks source link

Doesn't handle Domain\Username or Username@Domain properly #38

Closed Tycho-S closed 6 years ago

Tycho-S commented 6 years ago

The script breaks if you enter your username in Domain\Username or Username@Domain formats :)

In our case this is necessary because we have multiple forests. It's quite probable that the machine is joined to the correct domain but not guaranteed.

The problem is that in this case it fails to create the new user correctly but it does delete the old one so it's a mess to clean up :)

Also, why not check for a functioning ID by checking whether the given username exists instead of another account? Then this wouldn't happen.

rtrouton commented 6 years ago

Pull requests accepted.

Tycho-S commented 6 years ago

It was just a suggestion :) Perhaps you could add an explanation in the readme that the username must be entered without the domain.

I would submit a pull request but I started from scratch using PHP, I don't really like bash when it gets complex. I might publish it separately however I'm including a lot of automation of things like setting the machine name according to our internal standards.