Find Users on Multiple Domains

It’s been too long! I miss blogging. Alas, sometimes life gets busy and customers get demanding!

It’s been a crazy few months, and I’ve got more stuff to blog than I ever thought was remotely possible, but here’s a really cool one I wanted to share!

I’ve been helping my coworker, Seth, design a User-Onboarding script for a customer. They have 4 domains, but with a trust relationship between them so I can search from everywhere. That said, I can’t cascade my search from the top down, well, I’m not sure why. Apparently “get-aduser” isn’t that smart!

That said, I made a script to search for a user object in an array of domains, and then drop out of the loop once it finds the username. It’s pretty nifity, and you can do creative bits to read in multiple domains (static coded, csv, xml, text, etc.).

I’ll let the code do the talking 🙂