<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Indented! &#187; import</title>
	<atom:link href="http://www.indented.co.uk/index.php/tag/import/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indented.co.uk</link>
	<description></description>
	<lastBuildDate>Fri, 02 Jul 2010 10:45:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Import contacts from a csv file using VbScript</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/</link>
		<comments>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 17:25:28 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[VbScript]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[vbs]]></category>

		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=377</guid>
		<description><![CDATA[Download ContactImport.vbs This script will create contacts in Active Directory based on a formatted CSV file. It was written to allow automatic synchronisation of contacts using a CSV file as the source. The usage for the script will echo when run without any parameters. Here&#8217;s a summary: cscript ContactImport.vbs -f &#60;file Name&#62; -o &#34;&#60;organisational Unit [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href='http://69.164.211.174/wp-content/uploads/2008/10/contactimport.txt'>Download ContactImport.vbs</a></p>
<p>This script will create contacts in Active Directory based on a formatted CSV file. It was written to allow automatic synchronisation of contacts using a CSV file as the source.<br />
<span id="more-377"></span><br />
The usage for the script will echo when run without any parameters. Here&#8217;s a summary:</p>
<pre class="brush: plain;">
cscript ContactImport.vbs -f &lt;file Name&gt; -o &quot;&lt;organisational Unit Path&gt;&quot;
    [-r] [-s] [-a &lt;attributes&gt;] [-d &lt;delimiter&gt;] [-n &quot;&lt;name Format&gt;&quot;] [-t]

  -f &lt;file Name&gt; - Input File Name (Required)
  -o &lt;organisational Unit Path&gt; - Target OU for Contact Objects (Required)
  -r - Read the Header Line as AD Fields
  -s - Skip the Header Line
  -a &lt;attributes&gt; - AD Attibutes to write Fields to
    (Required if not using Header)
  -d &lt;delimiter&gt; - File Delimiter. Uses comma if not specified.
  -n &lt;name Format&gt; - DisplayName and CN Format by AD Attributes.
    Uses TargetAddress if not specified.
  -t - Test Only
</pre>
<h3>Usage examples</h3>
<h4>Reading data from a CSV using the header line as fields</h4>
<p>Example CSV file data:</p>
<pre class="brush: plain;">
givenName,sn,TargetAddress,streetAddress,streetAddress
Chris,Dent,chris.dent@somedomain.example,123 Somewhere Street,London
</pre>
<p>The following command will read the header line as the fields to import, then create contacts using givenName and sn as the display name / name.</p>
<pre class="brush: plain;">
cscript ContactImport.vbs -f Contacts.csv -o &quot;OU=Contacts,DC=somedomain,DC=example&quot; -r -n &quot;givenName sn&quot;
</pre>
<p>The attribute streetAddress appears twice, it will be concatenated using a comma as a delimiter. The streetAddress attribute will contain &#8220;123 Somewhere Street, London&#8221; in this example.</p>
<h4>Defining attributes on the command line</h4>
<p>Example CSV file data:</p>
<pre class="brush: plain;">
Chris,Dent,chris.dent@somedomain.example,SomeCorp,SomeOffice
</pre>
<p>The following command will read the file, then import attributes based on the -a value which must reflect the order of attributes in the import file.</p>
<pre class="brush: plain;">
cscript ContactImport.vbs -f Contacts.csv -o &quot;OU=Contacts,DC=somedomain,DC=example&quot; -a &quot;givenName,sn,targetAddress,company,physicalDeliveryOfficeName&quot;
</pre>
<p>Because no displayName format has been specified the targetAddress field will be used.</p>
<h4>Using a custom file delimiter</h4>
<p>Example file data:</p>
<pre class="brush: plain;">
FirstName|LastName|Address
Chris|Dent|chris@somedomain.example
</pre>
<p>In this example the header line contains names that cannot be used as attributes in Active Directory so the script is instructed to ignore it with -s. The fields are defined instead using the -a option. The Delimited is specified with -d.</p>
<pre class="brush: plain;">
cscript ContactImport.vbs -f Contacts.txt -o &quot;OU=Contacts,DC=somedomain,DC=example&quot; -a &quot;givenName,sn,targetAddress&quot; -s -d &quot;|&quot;
</pre>
<p>As above, because no displayName format is specified the targetAddress is used.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.indented.co.uk/index.php/2008/10/21/vbscript-import-contacts-from-a-csv-file/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
