Wednesday, September 09, 2009

Overcoming Fear

I talk a pretty big game. I live and die by VB script, but when it comes to scripting, I feel much more comfortable querying than modifying. I'll pull information from Active Directory all day long, but please don't ask me to batch-mod 1000 users. I'll probably barf in abject terror. What if it goes wrong? The scripts generally run so fast that I can't stop them before they complete. What if I inadvertently disable 100% of user accounts on the domain, or delete an entire OU (I've seen both happen)?

But yesterday I took the plunge. Because of some buffoon's inability to properly code his/her software, I had to remove the dashes and parentheses from all phone numbers in AD. Easy enough to query, not so easy to modify, especially for the timid.

But I found a few tricks, cringed and hyperventilated while testing on a couple of accounts, and then closed my eyes and pressed the "Nuke" button.

Ho. Lee. Shit.

202 instantaneous changes, and no glitches. So I expanded it to all 10-digit numbers (essentially all US phone numbers). Again: no glitches.

So now I'm positively giddy. Today I undertook to change postal addresses in bulk. Every user now has his or her site's mailing address, including international (which meant learning about ISO 3166 A-2 country codes).

I am in nerd heaven right now.

No comments: