{"id":213,"date":"2008-10-22T16:51:36","date_gmt":"2008-10-22T16:51:36","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?page_id=213"},"modified":"2008-10-22T16:51:36","modified_gmt":"2008-10-22T16:51:36","slug":"add_contacts_noemailvbs","status":"publish","type":"page","link":"https:\/\/www.wapshere.com\/missmiis\/add_contacts_noemailvbs","title":{"rendered":"add_contacts_noemail.vbs"},"content":{"rendered":"<pre>' Add contacts into AD that don't have email addresses.\r\n' This was used in combination with add_contacts.ps1 to add\r\n' all the extra information about the contact, and to get around\r\n' the restriction of the new-mailcontact cmdlet.<\/pre>\n<pre>On error resume next\r\nDim objRoot, objOU, objDomain, objContact, strYourDescription\r\nDim strDNS, strContainer, strContactName, strEmail\r\nDim objFSO, objFile, strLine, strItems<\/pre>\n<pre>\r\nSet objOU = GetObject(\"LDAP:\/\/OU=Contacts,OU=BBH,DC=bbhfgg,DC=local\")<\/pre>\n<pre>set objFSO = CreateObject(\"Scripting.FileSystemObject\")\r\nset objFile = objFSO.OpenTextFile(\"C:\\scripts\\contacts_noemail.csv\")<\/pre>\n<pre>Do Until objFile.AtEndOfStream\r\n\u00c2\u00a0 strLine = objFile.ReadLine\r\n\u00c2\u00a0 strItems = split(strLine,\",\")<\/pre>\n<pre>\u00c2\u00a0 name = strItems(0)<\/pre>\n<pre>wscript.echo name<\/pre>\n<pre>' Section to create the contact\r\nSet objContact = objOU.Create(\"contact\", \"CN=\" &amp; name)\r\nobjContact.SetInfo<\/pre>\n<pre>Loop<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8216; Add contacts into AD that don&#8217;t have email addresses. &#8216; This was used in combination with add_contacts.ps1 to add &#8216; all the extra information about the contact, and to get around &#8216; the restriction of the new-mailcontact cmdlet. On error resume next Dim objRoot, objOU, objDomain, objContact, strYourDescription Dim strDNS, strContainer, strContactName, strEmail Dim&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-213","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/Pkp1o-3r","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/pages\/213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":1,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/pages\/213\/revisions"}],"predecessor-version":[{"id":214,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/pages\/213\/revisions\/214"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}