add_contacts_noemail.vbs

' Add contacts into AD that don't have email addresses.
' This was used in combination with add_contacts.ps1 to add
' all the extra information about the contact, and to get around
' the restriction of the new-mailcontact cmdlet.
On error resume next
Dim objRoot, objOU, objDomain, objContact, strYourDescription
Dim strDNS, strContainer, strContactName, strEmail
Dim objFSO, objFile, strLine, strItems
Set objOU = GetObject("LDAP://OU=Contacts,OU=BBH,DC=bbhfgg,DC=local")
set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile("C:\scripts\contacts_noemail.csv")
Do Until objFile.AtEndOfStream
  strLine = objFile.ReadLine
  strItems = split(strLine,",")
  name = strItems(0)
wscript.echo name
' Section to create the contact
Set objContact = objOU.Create("contact", "CN=" & name)
objContact.SetInfo
Loop