2006
08.09

Here is a little script I cooked up to help us with the migration from Groupwise to Exchange a couple of months ago. It will take a .nab file exported from Groupwise and convert the field names into Outlook compatible names so the Outook import wizard will map them properly into the contacts list. It will replace the contents of the input file. It also strips out any of the old “internet:” prefixed addresses left over from older versions of Groupwise if you have any. This was a real lifesaver for me when doing the conversion.

Const ForReading = 1
Const ForWriting = 2

Set objArgs = WScript.Arguments

Dim arrFieldSearch
Dim arrFieldReplace
arrFieldSearch = Array("@DOMAIN.GWIA",".DOMAIN.GWIA",
  ".GWIA.DOMAIN","internet:","Internet:",
  "INTERNET:",":::TAGMAP:::0FFE0003:***",
  "3001001E:Name","3A08001E:Office Phone Number",
  "3A18001E:Department","3A23001E:Fax Number",
  "3003001E:E-Mail Address","3A06001E:FirstName",
  "3A11001E:LastName","3A17001E:Title",
  "3A29001E:Address","3A27001E:City","3A28001E:State",
  "3A26001E:Country","3A2A001E:ZIP Code","3002001E:E-Mail Type",
  "3A19001E:Mailstop","3A09001E:Home Phone Number",
  "3A1C001E:Cellular Phone Number","3A21001E:Pager Number",
  "3A1A001E:Phone Number","600B001E:Greeting",
  "600F001E:Owner","3A16001E:Organization","3004001E:Comments",
  "3A00001E:User ID","6604001E:Domain","6609001E:Additional Routing",
  "6605001E:Post Office","6603001E:GUID","6607001E:NDS Distinguished Name",
  "6608001E:Network ID","660D001E:Internet Domain","8000001E:Pumatech_ID"
)

arrFieldReplace = Array("","","","","","","Category","Name",
  "Company Main Phone","Department","Business Fax",
  "E-Mail Address","First Name","Last Name","Job Title",
  "Business Street","Business City","Business State","Business Country",
  "Business Postal Code","E-Mail Type","Office Location","Home Phone",
  "Mobile Phone","Pager","Business Phone","Title","User 1","Company",
  "Notes","User 2","User 3","Office Location","Post Office",
  "6603001E:GUID","6607001E:NDS Distinguished Name",
  "6608001E:Network ID","660D001E:Internet Domain","8000001E:Pumatech_ID"
)

For F = 0 to objArgs.Count - 1
  strFileName = objArgs(F)
  WScript.echo F & ". " & strFileName
  
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.OpenTextFile(strFileName, ForReading)
  
  strText = objFile.ReadAll
  objFile.Close
  
  i = 0
  For Each strSearchFor in arrFieldSearch
    strReplaceWith = arrFieldReplace(i)
    strNewText = Replace(strText, strSearchFor, strReplaceWith, 1, -1, 1)
    strText = strNewText
    i = i + 1
  Next
  
  Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
  objFile.WriteLine strNewText
  objFile.Close
Next

WScript.echo "Finished Conversion!"

Just copy the code into a file called “abconvert.vbs” and put it into your “Send To” folder. Then just right-click on an exported .nab file and send it to the script.

Switch to our mobile site