I have been crafting one time batch jobs in Excel for years. The day someone showed me this obvious trick I was like β<duh!>β and have been doing it ever since. Frankly sometimes itβs infinitely easier than any sort of reusable script-ware. I do this with data cleanup all the time too. Export the data from Oracle/SQL to a CSV, import to Excel, fix it, then turn each row into a separate UPDATE call and paste it into the database tool.
Thanks, Brian Desmond [email protected]<mailto:[email protected]> c β 312.731.3132 From: David Lum [mailto:[email protected]] Sent: Saturday, February 05, 2011 6:14 PM To: NT System Admin Issues Subject: RE: Knock me down a notch (aka some days, I am too proud of myself) Wow, that came to the list looking like a$$... -----Original Message----- From: David Lum [mailto:[email protected]] Sent: Saturday, February 05, 2011 4:12 PM To: NT System Admin Issues Subject: Knock me down a notch (aka some days, I am too proud of myself) So today I am rolling back an abortive outsourcing Exchange attempt. Long story but here's what gives me one of those "maybe I am Dr. Evil" moments. I have 600+ .PST files I need to import into Exchange 2007. The PST file names match the mailbox names. Michael and other PS guru's probably have a better solution than mine so I am game to here it, but here's my dorkatude: 1. In the directory with the PST's (about 100pst's per folder), I do DIR > GROUPx.TXT 2. Open said TXT file in Excel, setting columns to separate out file names from other garbage (delete all columns except file names) 3. Now having just the list of files, I add a columns to the left and right 3a Column A is part of a powershell command dir D:\ExchangeImport\Groupx\ 3b Column B is the list of PST file names 3c Column C is | import-mailbox -Confirm:$false 3d Column D is =A1&B1&C1 and concatenates each line into a tidy PS command like dir D:\ExchangeImport\Group4\bob.johnson.pst | import-mailbox -Confirm:$false 4. Take column D and paste into Notepad and save as .PS1 file 5. Run PS1 file Start to finish it's *maybe* 5 mins per group of PST's to make a .PS1 file. I laugh that overall it's command prompt, Excel, cut and paste to Notepad, and PowerShell. In my particular case Excel isn't on the target box so I am actually pasting to my local notepad and saving it before opening in Excel. Also having 7 groups means I open 7 PowerShell sessions and let 'em rip So...am I actually clever, or is this really a long way around? Dave "2hs sleep might impair my judgement" Lum ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to [email protected]<mailto:[email protected]> with the body: unsubscribe ntsysadmin ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to [email protected]<mailto:[email protected]> with the body: unsubscribe ntsysadmin ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to [email protected] with the body: unsubscribe ntsysadmin
