<?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>PTS</title>
	<atom:link href="http://www.propriustech.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.propriustech.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 26 Aug 2012 18:34:02 +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>Back to School with Windows Server 2008 R2</title>
		<link>http://www.propriustech.com/blog/?p=8</link>
		<comments>http://www.propriustech.com/blog/?p=8#comments</comments>
		<pubDate>Sun, 22 Aug 2010 22:27:39 +0000</pubDate>
		<dc:creator>DEWesley</dc:creator>
				<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">http://www.propriustech.com/blog/?p=8</guid>
		<description><![CDATA[Importing User Accounts into Active Directory from a CSV file with Import-CSV and New-ADUser]]></description>
			<content:encoded><![CDATA[<p>It’s that time of year again. Many students, administrators, faculty and IT professionals are headed back to school. In honor of the season, below is a quick how-to featuring two PowerShell commands in Windows Server 2008 R2.</p>
<p><strong>Importing User Accounts into Active Directory from a CSV file with Import-CSV and New-ADUser</strong></p>
<p>Step One: Prepare the CSV File</p>
<p>For the user file, we can use the same column headers as the traditional CSVDE data import. This way we are able to use the familiar headings, while taking advantage of features in the Import-CSV command in Windows Server 2008 R2. Follow the below steps if you need a list of available headings for use in your CSV file.</p>
<p>Open a Command Prompt on your Windows Server 2008 R2 server. At the Command Prompt, enter the following command:</p>
<p><strong>csvde -d &#8220;cn=users,dc=domain,dc=com&#8221; -f c:\foldername\filename.csv</strong></p>
<p>This command will export all the objects in your ‘Users’ container. The available CSVDE column headings will most likely exceed 100 (especially if you have Exchange 2007 or 2010 in your domain).</p>
<p>Now that we have a list of available column names, let’s get down to the business of building our CSV import file. Here’s my completely unimpressive example, but hey, it works.</p>
<p><a rel="attachment wp-att-10" href="http://www.propriustech.com/blog/?attachment_id=10"><img class="alignnone size-medium wp-image-10" title="CSV_Users" src="http://www.propriustech.com/blog/wp-content/ups/2010/08/CSV_Users-300x56.png" alt="CSV_Users Example" width="300" height="56" /></a></p>
<p>The above example will import the user accounts into the default “Users” container in Active Directory.</p>
<p>Step Two: Import the CSV file</p>
<p>Navigate to the following console on your Windows 7 Administrator workstation, with the Remote Server Admin Tools (RSAT) installed, or on a Server 2008 R2 domain controller:</p>
<p><strong>Start &gt; Administrative Tools &gt; Active Directory Module for Windows PowerShell</strong></p>
<p><strong><a rel="attachment wp-att-13" href="http://www.propriustech.com/blog/?attachment_id=13"><img class="alignnone size-medium wp-image-13" title="ADM_for_PS" src="http://www.propriustech.com/blog/wp-content/ups/2010/08/ADM_for_PS-300x180.png" alt="ADM_for_PS" width="300" height="180" /></a><br />
</strong></p>
<p>(If needed, you can download the RSAT tools for Windows 7 <a title="RSAT Windows 7" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d&amp;displaylang=en" target="_blank">here</a>.)</p>
<p>Now we run the following command:</p>
<p><strong>Import-Csv &lt;location of your csv file&gt; | New-ADUser</strong></p>
<p>An example:<br />
Import-Csv c:\data\stu.csv | New-ADUser</p>
<p><a rel="attachment wp-att-14" href="http://www.propriustech.com/blog/?attachment_id=14"><img class="alignnone size-medium wp-image-14" title="Import-CSV_Command" src="http://www.propriustech.com/blog/wp-content/ups/2010/08/ImportCommand-300x29.png" alt="Import-CSV_Command" width="300" height="29" /></a></p>
<p>If successful, you’ll receive the helpful… well, you won’t receive anything really. Except for another prompt &#8211; this is much better than a big red error.</p>
<p>The Active Directory aftermath:</p>
<p><a rel="attachment wp-att-15" href="http://www.propriustech.com/blog/?attachment_id=15"><img class="alignnone size-medium wp-image-15" title="UsersInAD" src="http://www.propriustech.com/blog/wp-content/ups/2010/08/UsersInAD-300x62.png" alt="UsersInAD" width="300" height="62" /></a></p>
<p>The next level:</p>
<p>The above is enough to get us started, but there are many more options available for importing /creating / modifying Active Directory accounts using the New-ADUser command. Remember, as with all PowerShell commands, an excellent help file (man page) is available from the shell console. The following commands will show the full help files for the<br />
New-ADUser and Import-CSV commands:</p>
<p><strong>Get-Help New-ADUser -Full</strong></p>
<p><strong>Get-Help Import-Csv -Full</strong></p>
<p>Good luck, and have fun!</p>
<p>-DE Wesley</p>
]]></content:encoded>
			<wfw:commentRss>http://www.propriustech.com/blog/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
