<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Import contacts from a csv file using VbScript</title>
	<atom:link href="http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/</link>
	<description></description>
	<lastBuildDate>Wed, 21 Dec 2011 09:33:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Gary</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/comment-page-1/#comment-696</link>
		<dc:creator>Gary</dc:creator>
		<pubDate>Wed, 08 Jun 2011 18:16:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377#comment-696</guid>
		<description>This script is fantastic.

If your domain name changes, update your csv file and then rerun this script.  It will update all the contacts. 

Absolutely fantastic.</description>
		<content:encoded><![CDATA[<p>This script is fantastic.</p>
<p>If your domain name changes, update your csv file and then rerun this script.  It will update all the contacts. </p>
<p>Absolutely fantastic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: josh</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/comment-page-1/#comment-639</link>
		<dc:creator>josh</dc:creator>
		<pubDate>Fri, 04 Mar 2011 14:31:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377#comment-639</guid>
		<description>one other thing that is important if exchange is to send email to these contacts is the field internetEncoding, which needed to be set to 1310720 in order to work..</description>
		<content:encoded><![CDATA[<p>one other thing that is important if exchange is to send email to these contacts is the field internetEncoding, which needed to be set to 1310720 in order to work..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/comment-page-1/#comment-594</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 04 Feb 2011 08:42:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377#comment-594</guid>
		<description>No problem, I&#039;m glad you got it working in the end :)

Chris</description>
		<content:encoded><![CDATA[<p>No problem, I&#8217;m glad you got it working in the end :)</p>
<p>Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/comment-page-1/#comment-593</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 04 Feb 2011 00:42:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377#comment-593</guid>
		<description>Chris!
I got it working.  I am not sure just how elegant it is but it definitely works.  When reading the file you match the attribute with the value using = then later on you split it using = for creating and updating the contact.
All I did was replace the = with ^ in the 4 locations needed in the script and bing off we go.

Thank you so much for spending your own time in coming up with the Proxyaddress update.  It has saved me so much time and pain.

Cheers,
Steve</description>
		<content:encoded><![CDATA[<p>Chris!<br />
I got it working.  I am not sure just how elegant it is but it definitely works.  When reading the file you match the attribute with the value using = then later on you split it using = for creating and updating the contact.<br />
All I did was replace the = with ^ in the 4 locations needed in the script and bing off we go.</p>
<p>Thank you so much for spending your own time in coming up with the Proxyaddress update.  It has saved me so much time and pain.</p>
<p>Cheers,<br />
Steve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/comment-page-1/#comment-591</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Thu, 03 Feb 2011 23:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377#comment-591</guid>
		<description>Hi Chris,
I have given it a go with some success.  I have replaced the separator with ; for the proxyaddresses and importing multiple SMTP addresses works correctly.  When entering in a X500 address with the format like:
X500:/O=FCL/OU=AUST/cn=Recipients/cn=TestContact the import doesn&#039;t work. 
This is the log entry for it:
Appending proxyaddresses Attribute: aaEmail aaMigration - company: New: /o

The problem I think is this proxyaddresses is also delimited by =  which is breaking up the X500 address.
So I think before it even gets to the adding proxyaddresses the string is broken.

I am working through it here to see if I can get it to parse the address correctly but any assistance would be great!

Cheers,
Steve</description>
		<content:encoded><![CDATA[<p>Hi Chris,<br />
I have given it a go with some success.  I have replaced the separator with ; for the proxyaddresses and importing multiple SMTP addresses works correctly.  When entering in a X500 address with the format like:<br />
X500:/O=FCL/OU=AUST/cn=Recipients/cn=TestContact the import doesn&#8217;t work.<br />
This is the log entry for it:<br />
Appending proxyaddresses Attribute: aaEmail aaMigration &#8211; company: New: /o</p>
<p>The problem I think is this proxyaddresses is also delimited by =  which is breaking up the X500 address.<br />
So I think before it even gets to the adding proxyaddresses the string is broken.</p>
<p>I am working through it here to see if I can get it to parse the address correctly but any assistance would be great!</p>
<p>Cheers,<br />
Steve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/comment-page-1/#comment-590</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Thu, 03 Feb 2011 20:51:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377#comment-590</guid>
		<description>Amazing!  Thank you so much!
I will give it a go today!

Cheers,
Steve</description>
		<content:encoded><![CDATA[<p>Amazing!  Thank you so much!<br />
I will give it a go today!</p>
<p>Cheers,<br />
Steve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/comment-page-1/#comment-589</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 03 Feb 2011 08:53:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377#comment-589</guid>
		<description>Hmm in theory it might work if you call the field proxyAddresses, and use the modified CheckUpdate Subroutine below. Ensure you include the address type prefix (e.g. smtp:bob@domain.example X500:/somevalue/).

Afraid I can&#039;t test it, but if you&#039;d like to take the update for a spin? :)
[code lang=&quot;vb&quot;]
Sub CheckUpdate(objContact, strAttribute, strValue)
	Const ADS_PROPERTY_APPEND = 3

	Dim strCurrentValue
	Dim arrValues

	On Error Resume Next

	If LCase(strAttribute) = &quot;proxyaddresses&quot; Then
		arrValues = Split(strValue, &quot;, &quot;)
		For Each strValue in arrValues
			WriteLog &quot;Appending &quot; &amp; strAttribute &amp; &quot; Attribute: &quot; &amp;_
				objContact.Get(&quot;displayName&quot;) &amp; &quot;: New: &quot; &amp; strValue, True
			If booTestOnly = False Then
				Err.Clear
				objContact.PutEx ADS_PROPERTY_APPEND, strAttribute, Array(strValue)
				objContact.SetInfo
				If Err.Number &lt;&gt; 0 Then
					WriteLog objContact.Name &amp; &quot;: Error Updating &quot; &amp; strAttribute &amp; &quot; with &quot; &amp; strValue, True
					WriteLog objContact.Name &amp; &quot;: &quot; &amp; Err.Description
				End If
			End If
		Next
	Else
		strCurrentValue = &quot;&quot; : strCurrentValue = objContact.Get(strAttribute)
 		If LCase(strCurrentValue) &lt;&gt; LCase(strValue) Then
			WriteLog &quot;Updating &quot; &amp; strAttribute &amp; &quot; Attribute: &quot; &amp;_
				objContact.Get(&quot;displayName&quot;) &amp; &quot;: Old: &quot; &amp; strCurrentValue &amp;_
				&quot; New: &quot; &amp; strValue, True
			If booTestOnly = False Then
				Err.Clear
				objContact.Put strAttribute, strValue
				objContact.SetInfo
				If Err.Number &lt;&gt; 0 Then
					WriteLog objContact.Name &amp; &quot;: Error Updating &quot; &amp; strAttribute &amp; &quot; with &quot; &amp; strValue, True
					WriteLog objContact.Name &amp; &quot;: &quot; &amp; Err.Description
				End If
			End If
		End If
	End If

	On Error Goto 0
End Sub
[/code]

Chris</description>
		<content:encoded><![CDATA[<p>Hmm in theory it might work if you call the field proxyAddresses, and use the modified CheckUpdate Subroutine below. Ensure you include the address type prefix (e.g. smtp:bob@domain.example X500:/somevalue/).</p>
<p>Afraid I can&#8217;t test it, but if you&#8217;d like to take the update for a spin? :)</p>
<pre class="brush: vb; title: ; notranslate">
Sub CheckUpdate(objContact, strAttribute, strValue)
	Const ADS_PROPERTY_APPEND = 3

	Dim strCurrentValue
	Dim arrValues

	On Error Resume Next

	If LCase(strAttribute) = &quot;proxyaddresses&quot; Then
		arrValues = Split(strValue, &quot;, &quot;)
		For Each strValue in arrValues
			WriteLog &quot;Appending &quot; &amp; strAttribute &amp; &quot; Attribute: &quot; &amp;_
				objContact.Get(&quot;displayName&quot;) &amp; &quot;: New: &quot; &amp; strValue, True
			If booTestOnly = False Then
				Err.Clear
				objContact.PutEx ADS_PROPERTY_APPEND, strAttribute, Array(strValue)
				objContact.SetInfo
				If Err.Number &lt;&gt; 0 Then
					WriteLog objContact.Name &amp; &quot;: Error Updating &quot; &amp; strAttribute &amp; &quot; with &quot; &amp; strValue, True
					WriteLog objContact.Name &amp; &quot;: &quot; &amp; Err.Description
				End If
			End If
		Next
	Else
		strCurrentValue = &quot;&quot; : strCurrentValue = objContact.Get(strAttribute)
 		If LCase(strCurrentValue) &lt;&gt; LCase(strValue) Then
			WriteLog &quot;Updating &quot; &amp; strAttribute &amp; &quot; Attribute: &quot; &amp;_
				objContact.Get(&quot;displayName&quot;) &amp; &quot;: Old: &quot; &amp; strCurrentValue &amp;_
				&quot; New: &quot; &amp; strValue, True
			If booTestOnly = False Then
				Err.Clear
				objContact.Put strAttribute, strValue
				objContact.SetInfo
				If Err.Number &lt;&gt; 0 Then
					WriteLog objContact.Name &amp; &quot;: Error Updating &quot; &amp; strAttribute &amp; &quot; with &quot; &amp; strValue, True
					WriteLog objContact.Name &amp; &quot;: &quot; &amp; Err.Description
				End If
			End If
		End If
	End If

	On Error Goto 0
End Sub
</pre>
<p>Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/comment-page-1/#comment-588</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Thu, 03 Feb 2011 02:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377#comment-588</guid>
		<description>Hi Chris,
For the life of me I have not been able to replicate the issue again.  I have tried a few different combinations with the givenname first but they have all worked successfully.  

There is another question I have in regards to Proxyaddresses.  Is it possible to import multiple proxyaddresses with the script?  For instance I need to be able to include the standard SMTP proxy address but also an X500 address.  I have tried using a few different delimiter types but so far I haven&#039;t had any luck.

Cheers,
Steve</description>
		<content:encoded><![CDATA[<p>Hi Chris,<br />
For the life of me I have not been able to replicate the issue again.  I have tried a few different combinations with the givenname first but they have all worked successfully.  </p>
<p>There is another question I have in regards to Proxyaddresses.  Is it possible to import multiple proxyaddresses with the script?  For instance I need to be able to include the standard SMTP proxy address but also an X500 address.  I have tried using a few different delimiter types but so far I haven&#8217;t had any luck.</p>
<p>Cheers,<br />
Steve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/comment-page-1/#comment-542</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 14 Jan 2011 09:00:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377#comment-542</guid>
		<description>That&#039;s a little unexpected. Would you be able to provide a sample of the file you&#039;re using? I tried to duplicate with this one but cannot reproduce the bug:

givenname,sn,company,targetAddress
bob,hope,somecompany,bob@hope.com

Associated command to execute the script:

cscript ContactImport.vbs -f test.csv -o &quot;OU=Somewhere,DC=domain,DC=example&quot; -r -t -n &quot;givenname sn - company&quot;</description>
		<content:encoded><![CDATA[<p>That&#8217;s a little unexpected. Would you be able to provide a sample of the file you&#8217;re using? I tried to duplicate with this one but cannot reproduce the bug:</p>
<p>givenname,sn,company,targetAddress<br />
bob,hope,somecompany,bob@hope.com</p>
<p>Associated command to execute the script:</p>
<p>cscript ContactImport.vbs -f test.csv -o &#8220;OU=Somewhere,DC=domain,DC=example&#8221; -r -t -n &#8220;givenname sn &#8211; company&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/comment-page-1/#comment-540</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 14 Jan 2011 03:03:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377#comment-540</guid>
		<description>Hi Chris,
3  years later and still posting about this script :)
I agree with everyones comments, this script works rather damn well.  Thankyou!

I did have one interesting issue with it though.  
In my import CSV if I ran with givename as the first column, for some reason my display name when using the -n switch and specifying givenname (or givenname sn - company) would concatenate both the sn + givenname (bloggsjoe) for the Displayname (bloggsjoe bloggs - company). 
If you change the first column to something other than Givenname first (I used company) it works perfectly. 
I am not quite sure how this is happening or why, I spent a bit of time looking through the code but just couldn&#039;t pick where it was doing it.

Cheers,
Steve</description>
		<content:encoded><![CDATA[<p>Hi Chris,<br />
3  years later and still posting about this script :)<br />
I agree with everyones comments, this script works rather damn well.  Thankyou!</p>
<p>I did have one interesting issue with it though.<br />
In my import CSV if I ran with givename as the first column, for some reason my display name when using the -n switch and specifying givenname (or givenname sn &#8211; company) would concatenate both the sn + givenname (bloggsjoe) for the Displayname (bloggsjoe bloggs &#8211; company).<br />
If you change the first column to something other than Givenname first (I used company) it works perfectly.<br />
I am not quite sure how this is happening or why, I spent a bit of time looking through the code but just couldn&#8217;t pick where it was doing it.</p>
<p>Cheers,<br />
Steve</p>
]]></content:encoded>
	</item>
</channel>
</rss>

