<?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>Talk Tech To Me - GFI Blog &#187; Active Directory</title>
	<atom:link href="http://www.gfi.com/blog/tag/active-directory/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gfi.com/blog</link>
	<description>Brought to you by GFI Software</description>
	<lastBuildDate>Fri, 10 Feb 2012 17:18:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>57 Tips Every Admin Should Know</title>
		<link>http://www.gfi.com/blog/57-tips-admin/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=57-tips-admin</link>
		<comments>http://www.gfi.com/blog/57-tips-admin/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 14:00:14 +0000</pubDate>
		<dc:creator>Emmanuel Carabott</dc:creator>
				<category><![CDATA[Headline]]></category>
		<category><![CDATA[Tech Zone]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[network admin]]></category>
		<category><![CDATA[or Windows 2008]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Networking]]></category>

		<guid isPermaLink="false">http://www.gfi.com/blog/?p=3447</guid>
		<description><![CDATA[The longer a person serves as a network admin, the more tips and tricks they are likely to pick up along the way. Some could be shortcuts, others might seem like magic, but all are intended to save you time &#8230;]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-3448" style="margin: 10px; border: 0px solid black;" title="tips every admin should know" src="http://www.gfi.com/blog/wp-content/uploads/2011/08/tips-every-admin-should-know-300x229.jpg" alt="" width="300" height="229" />The longer a person serves as a network admin, the more tips and tricks they are likely to pick up along the way. Some could be shortcuts, others might seem like magic, but all are intended to save you time and help you solve problems. Assume that all of these Windows commands should be run from an administrative command prompt if you are using Vista, Windows 7, or Windows 2008.<span id="more-3447"></span></p>
<h2>Active Directory</h2>
<p><strong>1. </strong>To quickly list all the groups in your domain, with members, run this command:</p>
<p>dsquery group -limit 0 | dsget group -members –expand</p>
<p><strong>2.</strong> To find all users whose accounts are set to have a non-expiring password, run this command:</p>
<p>dsquery * domainroot -filter &#8220;(&amp;(objectcategory=person)(objectclass=user)(lockoutTime=*))&#8221; -limit 0</p>
<p><strong>3.</strong> To list all the FSMO role holders in your forest, run this command:</p>
<p>netdom query fsmo</p>
<p><strong>4.</strong> To refresh group policy settings, run this command:</p>
<p>gpupdate</p>
<p><strong>5. </strong>To check Active Directory replication on a domain controller, run this command:</p>
<p>repadmin /replsummary</p>
<p><strong>6.</strong> To force replication from a domain controller without having to go through to Active</p>
<p>Directory Sites and Services, run this command:</p>
<p>repadmin /syncall</p>
<p><strong>7.</strong> To see what server authenticated you (or if you logged on with cached credentials) you can run either of these commands:</p>
<p>set l</p>
<p>echo %logonserver%</p>
<p><strong>8. </strong>To see what account you are logged on as, run this command:</p>
<p>whoami</p>
<p><strong>9.</strong> To see what security groups you belong to, run this command:</p>
<p>whoami /groups</p>
<p><strong>10.</strong> To see the domain account policy (password requirements, lockout thresholds, etc) run this command:</p>
<p>net accounts</p>
<h2>Windows Networking</h2>
<p><strong>11.</strong> To quickly reset your NIC back to DHCP with no manual settings, run this command:</p>
<p>netsh int ip reset all</p>
<p><strong>12.</strong> To quickly generate a text summary of your system, run this command:</p>
<p>systeminfo | more</p>
<p><strong>13.</strong> To see all network connections your client has open, run this command:</p>
<p>net use</p>
<p><strong>14.</strong> To see your routing table, run either of these commands:</p>
<p>route print</p>
<p>netstat -r</p>
<p><strong>15.</strong> Need to run a trace, but don’t have Netmon or Wireshark, and aren’t allowed to install either one? Run this command:</p>
<p>netsh trace start capture=yes tracefile=c:\capture.etl</p>
<p>netsh trace stop</p>
<p><strong>16. </strong>To quickly open a port on the firewall, run this command, changing the name, protocol, and port to suit. This example opens syslog:</p>
<p>netsh firewall set portopening udp 161 syslog enable all</p>
<p><strong>17.</strong> To add an entry to your routing table that will be permanent, run the route add command with the –p option. Omitting that, the entry will be lost at next reboot:</p>
<p>route add 0.0.0.0 mask 0.0.0.0 172.16.250.5 –p</p>
<p><strong>18.</strong> Here’s a simple way to see all open network connections, refreshing every second:</p>
<p>netstat –ano 1</p>
<p><strong>19.</strong> You can add a | findstr <em>value</em> to watch for only a specific connection, like a client ip.addr or port:</p>
<p>netstat –ano | findstr 216.134.217.20</p>
<p><strong>20.</strong> You can use the shutdown to shutdown or reboot a machine, including your own, in a simple scheduled task like this:</p>
<p>shutdown –r –t 0 –m \\localhost</p>
<p><strong>21.</strong> To make planned DNS changes go faster, reduce the TTL on the DNS records you plan on changing to 30 seconds the day before changes are to be made. You can set the TTL back to normal after you confirm the changes have been successful.</p>
<p><strong>22.</strong> Set a short lease on DHCP scopes that service laptops, and set Microsoft Option 002 to release a DHCP leas on shutdown. This helps to ensure your scope is not exhausted and that machines can easily get on another network when the move to a new site.</p>
<h2>Windows 7</h2>
<p><strong>23.</strong> Want to enable the local administrator account on Windows 7? Run this command from an administrative command prompt. It will prompt you to set a password:</p>
<p>net user administrator * /active:yes</p>
<p><strong>24.</strong> You can do the same thing during install by pressing SHIFT-F10 at the screen where you set your initial user password.</p>
<p>Windows 7 supports several useful new keyboard shortcuts:</p>
<p><strong>25.</strong> Windows Key+G</p>
<p>Display gadgets in front of other windows.</p>
<p><strong>26.</strong> Windows Key++ (plus key)</p>
<p>Zoom in, where appropriate.</p>
<p><strong>27. </strong>Windows Key+- (minus key)</p>
<p>Zoom out, where appropriate.</p>
<p><strong>28.</strong> Windows Key+Up Arrow</p>
<p>Maximize the current window.</p>
<p><strong>29.</strong> Windows Key+Down Arrow</p>
<p>Minimize the current window.</p>
<p><strong>30. </strong>Windows Key+Left Arrow</p>
<p>Snap to the left hand side of the screen</p>
<p><strong>31.</strong> Windows Key+Right Arrow</p>
<p>Snap to the right hand side of the screen.</p>
<p><strong>32. </strong>To quickly launch an application as an administrator (without the right-click, run as administrator), type the name in the Search programs and files field, and then press Ctrl-Shift-Enter.</p>
<p>Here are some tips that can save you from buying commercial software:</p>
<p><strong>33.</strong> Need to make a quick screencast to show someone how to do something? The Problem Steps Recorder can create an MHTML file that shows what you have done by creating a screen capture each time you take an action. Click the Start button and type ‘psr’ to open the Problem Steps Recorder.</p>
<p><strong>34. </strong>Need to burn a disc? The isoburn.exe can burn ISO and IMG files. You can right click a file and select burn, or launch it from the command line.</p>
<p><strong>35.</strong> Windows 7 includes a screen scraping tool called the Snipping Tool. I have tons of users request a license for SnagIt, only to find this free tool (it’s under Accessories) does what they need.</p>
<p><strong>36. </strong>You can download <a href="http://connect.microsoft.com/systemsweeper">this bootable security scanner</a> from Microsoft that will run off a USB key, which is very useful if you suspect a machine has a virus.</p>
<p><strong>37.</strong> A great way to save all your command line tools and make them available across all your computers is to install <a href="http://db.tt/W5FMJvy">Dropbox</a>, create a folder to save all your scripts and tools, and add that folder to your path. That way, they can be called from the command line or any other scripts, and if you update a script, it will carry across to any other machine you have.</p>
<h2>Windows 2008</h2>
<p><strong>38.</strong> You can free up disk space on your servers by disabling hibernate. Windows 2008 will create a hiberfil.sys equal to the amount of RAM. This is very useful with VMs that have lots of RAM but smaller C: drives. To disable hibernation, and reclaim that space, run this command:</p>
<p>powercfg -h off</p>
<p><strong>39.</strong> You can get to the complete collection of Sysinternals tools online. You can even invoke them from the run command. Use the url: <a href="http://live.sysinternals.com/">http://live.sysinternals.com</a> or the UNC path: <a href="file://live.sysinternals.com/tools">\\live.sysinternals.com\tools</a>.</p>
<p><strong>40.</strong> Speaking of the Sysinternals tools, almost any command line in this article can be run remotely on another machine (as long as you have administrative rights) using the psexec command included in the Sysinternals tools.</p>
<p><strong>41.</strong> You can kill RDP sessions at the command line when you find that all the RDP sessions to a server are tied up.</p>
<p>regsvr32 query.dll [enter] You only have to do this the first time.</p>
<p>query session /server:servername [enter]</p>
<p>reset session # /server:servername [enter]</p>
<p><strong>42.</strong> You can create a list of files and display the last time they were accessed, which is very useful when a network drive is low on space and users swear they have to have that copy of Office 2003 on the network. My advice? If they haven’t touched it in two years, burn it to DVD or write it to tape and then delete it from disk:</p>
<p>dir /t:a /s /od &gt;&gt; list.txt [enter]</p>
<p><strong>43.</strong> The Microsoft Exchange Err command is one of the best all around troubleshooting tools you will find, as it can decode any hex error code you find as long as the products are installed on the machine. Download it from <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=985">here</a>.</p>
<p><strong>44.</strong> You can see all the open files on a system by running this command:</p>
<p>openfiles /query</p>
<p><strong>45.</strong> You can pull all the readable data out of a corrupt file using this command:</p>
<p>recover filename.ext</p>
<p><strong>46. </strong>Need to pause a batch file for a period of time but don’t have the sleep command from the old resource kit handy? Here’s how to build a ten second delay into a script:</p>
<p>ping -n 10 127.0.0.1 &gt; NUL 2&gt;&amp;1</p>
<p><strong>47.</strong> If your Windows website has stopped responding, or is throwing a 500 error, and you are not sure what to do, you can reset IIS without having to reboot the whole server. Run this command:</p>
<p>iisreset</p>
<p><strong>48. </strong>You can use &amp;&amp; to string multiple commands together; they will run sequentially.</p>
<p><strong>49.</strong> If you find yourself restarting services frequently, you can use that &amp;&amp; trick to create a batch file called restart.cmd and use it to restart services:</p>
<p>net stop %1 &amp;&amp; net start %1</p>
<p><strong>50.</strong> You can download a Windows port of the wget tool <a href="http://gnuwin32.sourceforge.net/packages/wget.htm">from here</a>, and use it to mirror websites using this command:</p>
<p>wget -mk http://www.example.com/</p>
<h2>Linux</h2>
<p><strong>51.</strong> You can list files sorted by size using this command:</p>
<p>ls –lSr</p>
<p><strong>52.</strong> You can view the amount of free disk space in usable format using this command:</p>
<p>df –h</p>
<p><strong>53. </strong>To see how much space /some/dir is consuming:</p>
<p>du -sh /some/dir</p>
<p><strong>54.</strong> List all running processes containing the string stuff:</p>
<p>ps aux | grep stuff</p>
<p><strong>55. </strong>If you have ever run a command but forgot to sudo, you can use this to rerun the command:</p>
<p>sudo !!</p>
<p><strong>56.</strong> If you put a space before a command or response, it will be omitted from the shell history.</p>
<p><strong>57.</strong> If you really liked a long command that you just ran, and want to save it as a script, use this trick:</p>
<p>echo “!!” &gt; script.sh</p>
<p>With 57 tips in this bag of tricks, you’re bound to find something useful. Have your own tips to share? Leave us a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gfi.com/blog/57-tips-admin/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>CSVDE – A Means to Simplify Active Directory Administration (Part 3)</title>
		<link>http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=csvde-means-simplify-active-directory-administration-part-3</link>
		<comments>http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-3/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 14:07:09 +0000</pubDate>
		<dc:creator>Bernard Baldacchino</dc:creator>
				<category><![CDATA[Tech Zone]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[CSVDE]]></category>
		<category><![CDATA[LDAP]]></category>

		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1164</guid>
		<description><![CDATA[Importing Data from AD In Part 2 we  discussed how to export data from a working Active Directory installation. That was the easy part, now the real fun begins as we discuss how to import data to your Active Directory &#8230;]]></description>
			<content:encoded><![CDATA[<p><strong><a class="lightbox" title="CSVDE" href="http://www.gfi.com/blog/wp-content/uploads/2009/09/CSVDE1.jpg"><img class="alignright size-medium wp-image-1167" style="margin: 10px; border: 0px;" title="CSVDE" src="http://www.gfi.com/blog/wp-content/uploads/2009/09/CSVDE1-300x189.jpg" alt="" width="210" height="132" /></a>Importing Data from AD</strong></p>
<p>In Part 2 we  discussed <a href="http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-2/">how to export data from a working Active Directory installation</a>. That was the easy part, now the real fun begins as we discuss how to <em>import</em> data to your Active Directory installation. It is strongly suggested to try this out on a test scenario, and try this out as much as need until you are certain that you know what the different switches do, as this will affect your installation of AD.</p>
<p>There are a few things that need to be done before you can import data to your Active Directory installation. First of all you have to create a CSV file with all the details of your users, which requires some basic knowledge of LDAP properties, manipulation of strings in Excel and some basic knowledge of scripting (which will later allow you to enable all the accounts you have created with a simple double click!).</p>
<p><span id="more-1164"></span>First things first, what are LDAP Properties? Very simple, LDAP, or more fully Lightweight Directory Access Protocol, is an application protocol for querying and modifying directory services running over TCP/IP. A directory is a set of objects with attributes organized in a logical and hierarchical manner, or in plain English the properties of a user when you right click in Active Directory Users and Computers. There are countless options you can add, but for the sake of clarity we will stick to the 8 of the most basic ones you need to work with as described below:</p>
<p style="text-align: center;"><a class="lightbox" title="table1" href="http://www.gfi.com/blog/wp-content/uploads/2009/09/table1.PNG"><img class="aligncenter size-full wp-image-1165" title="table1" src="http://www.gfi.com/blog/wp-content/uploads/2009/09/table1.PNG" alt="" width="480" height="207" /></a></p>
<p>Now that we know what the fields we need are, we can start creating a CSV file. The easiest way to do this is by using a spreadsheet application, in this case Microsoft Excel, which has a built-in function that will create a CSV file by separating the columns with commas. Let us start creating our template in Excel. We will just create the first row and fill in the rest by clicking and dragging</p>
<p>It is very important that before you start you make sure that you have created the Organizational unit you will add the users to, as CSVDE is unable to create Organizational Units. For this example the OU that has been created is named Test.</p>
<p>Below you have an example, simply fill in the first row in your sheet (the ones in bold). Next fill in only the givenName and SN columns.</p>
<p><a class="lightbox" title="table2" href="http://www.gfi.com/blog/wp-content/uploads/2009/09/table2.PNG"><img class="aligncenter size-full wp-image-1166" title="table2" src="http://www.gfi.com/blog/wp-content/uploads/2009/09/table2.PNG" alt="" width="534" height="169" /></a></p>
<p>Now the real fun starts, as the rest of the columns will be filled using string manipulation formulas that are built-in in excel. First of all we must know what naming convention we will adhere to; in this case it will be the first letter of the first name and the entire surname.</p>
<p>Let us start off easy, by concatenating the contents of two different cells so as to create the name and CN fields:</p>
<p><em>=B2&amp;&#8221; &#8220;&amp;C2        </em></p>
<p>This will concatenate cells B2 and C3 with a space in the middle.</p>
<p>The sAMAccountName for our user will be jdoe, and will be created as follows:</p>
<p><em>=LOWER(LEFT(B2,1) &amp; (C2))         </em></p>
<p align="left">This will take the first letter on the left of cell B2  ‘LEFT(B2,1)’ and concatenate to the whole contents  of cell C2 using the ampersand (&amp;) and make sure it is all in lowercase (LOWER).</p>
<p>The process is similar for the userPrincipalName, but using the result of a previous formula:</p>
<p><em>=D2&amp;&#8221;@testdom.com&#8221;                 </em></p>
<p>This will concatenate the contents of cell D2 and append the name of the domain to it.</p>
<p>Finally the most complicated part, creating the Distinguished Name, which will use a combination of all the previous formulas to create a valid DN:</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="605" valign="top"><em>=&#8221;CN=&#8221;&amp; B2 &amp; &#8221; &#8221; &amp; C2 &amp; &#8220;,&#8221; &amp; &#8220;OU=Test,dc=testdom,dc=com&#8221;</em> This will create a field containing the complete distinguished name by concatenating a series of text entries to different other cells.</td>
</tr>
</tbody>
</table>
<p>Now fill in the rest of the names and surnames and simply click and drag the other cells to completely fill the table for all your users.</p>
<p>To create a CSV file simply press F12 (Save As…) and select CSV (Comma Separated) as file type, click save and click ok on the prompt that pops up, which warns you that all formatting will be lost and that it won’t let you save multiple books.</p>
<p>The one CSVDE switch we will use to import is the -i switch. This will load the data from any CSV file that has been specified in the command, import the data into Active Directory, and you can also output a report log to a specified file.</p>
<p>The command to import is:</p>
<p><em>CSVDE -i -k -f test.csv</em></p>
<p>Let us break down the different switches:</p>
<p><strong>-i</strong>                             The import switch which tells CSVDE that it has to import not the standard export.</p>
<p><strong>-k</strong>                            Tells CSVDE to ignore all errors and continue importing data.</p>
<p>-<strong>f &lt;filename&gt;</strong>    Specifies the file name of the CSV file to be imported.</p>
<p>Now launch Active Directory Users and Computers so as to verify the users have been created.</p>
<p><strong>Tip:</strong> Before running the CSVDE command, browse to the location of the CSV file so at to avoid typing long UPN path names which make for needless errors. eg. If the CSV file is stored in the Administrator’s documents make sure you have browsed to C:\Documents and Settings\Administrator\ before running the CSVDE command.</p>
<p>However, CSVDE has a limitation; it does not offer the functionality to enable the accounts that have just been created. Do not worry though, you will not have to enable the hundreds of accounts you have added one by one. There are various scripts available online that, with little editing, can help you enable all these accounts, along with the various flavours of the LDAP Property UserAccountControl, this gives you some flexibility on how and what exactly you can do. A good set of scripts and explanations of how they work and how to edit them can be found at the <a href="http://www.computerperformance.co.uk/ezine/ezine23.htm">Computer Performance</a> website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSVDE – A Means to Simplify Active Directory Administration (Part 2)</title>
		<link>http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=csvde-means-simplify-active-directory-administration-part-2</link>
		<comments>http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-2/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 09:40:00 +0000</pubDate>
		<dc:creator>Bernard Baldacchino</dc:creator>
				<category><![CDATA[Tech Zone]]></category>
		<category><![CDATA[Active Directory]]></category>

		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1009</guid>
		<description><![CDATA[In the first article of this series we discussed what CSVDE is and why you should use it. I will now discuss how to export data from Active Directory and how to import it in Microsoft Excel using CSVDE as well &#8230;]]></description>
			<content:encoded><![CDATA[<h2><a class="lightbox" title="CSVDE" href="http://www.gfi.com/blog/wp-content/uploads/2009/09/CSVDE.jpg"><img class="alignright size-medium wp-image-1011" style="margin: 10px; border: 0px;" title="CSVDE" src="http://www.gfi.com/blog/wp-content/uploads/2009/09/CSVDE-300x189.jpg" alt="" width="300" height="189" /></a></h2>
<p>In the first article of this series we discussed <a href="http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-1/">what CSVDE is and why you should use it</a>. I will now discuss how to export data from Active Directory and how to import it in Microsoft Excel using CSVDE as well as touch on some basic data manipulation commands.</p>
<h2>Exporting Data from AD</h2>
<p>The easiest way to learn CSVDE is through a baptism by fire - try out the commands yourself. However, most of you will think “How can I experiment with AD without ruining my setup?” The easiest way to do this is by learning to use the export commands, which simply exports data and does not in any way modify the setup that there is in place.</p>
<p><span id="more-1009"></span>When using the CSVDE tool, the command will always be formatted as follows:<br />
CSVDE &lt;-switch&gt;  or  CSVDE &lt;-switch&gt; &lt;switch requirement&gt;</p>
<p style="text-align: left;">Example:<br />
CSVDE –<em>f users.csv</em> runs the default CSVDE function, exporting all data to a file users.csv</p>
<p style="text-align: center;"><a class="lightbox" title="CSVDE - Pt 2" href="http://www.gfi.com/blog/wp-content/uploads/2009/09/CSVDE-Pt-2.JPG"><img class="size-medium wp-image-1132 aligncenter" style="margin-top: 10px; margin-bottom: 10px; border: 0px;" title="CSVDE - Pt 2" src="http://www.gfi.com/blog/wp-content/uploads/2009/09/CSVDE-Pt-2-300x142.jpg" alt="" width="300" height="142" /></a><br />
CSVDE -<em>f onlyusers.csv -r &#8220;(&amp;(objectClass=user)(objectCategory=person))&#8221;</em> exports only the specified details to users.csv.</p>
<p>The easiest way to view the data that has been exported by CSVDE is to locate the CSV file that was created, and open it using your favourite spreadsheet utility (all of them work, but here all examples will refer to Microsoft Excel). Note that CSVDE always exports to or imports from the current directory you are browsing in command prompt, thus if you are currently in c:\ it will save the files to c:\.</p>
<p>There a various switches that can be used and here&#8217;s <a href="http://www.computerperformance.co.uk/Logon/Logon_CSVDE_switches.htm" target="_blank">a complete list with a full description</a>. Here we will only discuss a few of the commands.<br />
 <br />
The most commonly used export switches:</p>
<ul>
<li><strong>-f</strong>  Specifies file name to export to:<br />
<em>CSVDE –f example.csv<br />
</em>Note: Try not to use this switch alone, as it will export too much data for it to be comprehensible and thus useful to us.</li>
<li><strong>-d</strong> Specifies a particular Object to export, such as an OU:<br />
<em>CSVDE -d &#8220;OU=&lt;ouname&gt;,DC=&lt;domainname&gt;,dc=com&#8221; -f example.csv<br />
</em></li>
<li><strong>-r</strong> Specifies which rows you want to export, such as users using the objectClass or object category:<br />
 <em>CSVDE –f example.csv –r objectClass=Person</em><br />
You can even combine multiple objects in your filter:<br />
<em>CSVDE -f userdata2.csv -r &#8220;(&amp;(objectCategory=person)(objectclass=user))&#8221;<br />
</em></li>
<li><strong>-L</strong> Specifies which LDAP fields, or columns, will be exported, separated by a comma:<br />
 <em>CSVDE –f example.csv –l &#8220;DN, objectClass, givenName, sn, name&#8221;</em><br />
<strong><span style="text-decoration: underline;">IMPORTANT!<br />
</span></strong>Do not mix <strong>–l</strong> with <strong>–i</strong> as they are used for two completely different things, thus since CSVDE is not case sensitive it would be wise to use <strong>–L</strong> to avoid confusion.</li>
<li><strong>-m</strong> Used to exclude Active Directory properties such as the ObjectGUID, objectSID, pwdLastSet  and samAccountType attributes.</li>
<li><strong>-n</strong> Used to exclude binary values from the exported CSV file.</li>
</ul>
<p>Thus, for example let us imagine you are an administrator, and you have been contacted by HR to produce a list of all the users in the Sales OU, with their Full Name, Logon and full distinguished name and without other junk such as binary data and so on. The command used to produce such a CSV file would be:</p>
<p><em>CSVDE -d &#8220;OU=Test,dc=bernard8,dc=com&#8221; -m -n -f testou.csv -r objectclass=user -l &#8220;name, userPrincipalName,dn&#8221;</em></p>
<p>In this case the first line of the CSV file would read:</p>
<p>DN,name,userPrincipalName</p>
<p>&#8220;CN=John Smith,OU=Test,DC=test,DC=com&#8221;,John Smith,jsmith@test.com</p>
<p>For some reason CSVDE sorts the LDAP fields in its own way no matter how you enter the data.</p>
<p>Now you should be <a href="http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-3/">confident enough with CSVDE to be ready to try the import switch</a>, which we will discuss in part 3 of this article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSVDE – A Means to Simplify Active Directory Administration (Part 1)</title>
		<link>http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=csvde-means-simplify-active-directory-administration-part-1</link>
		<comments>http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-1/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 13:27:31 +0000</pubDate>
		<dc:creator>Bernard Baldacchino</dc:creator>
				<category><![CDATA[Tech Zone]]></category>
		<category><![CDATA[Active Directory]]></category>

		<guid isPermaLink="false">http://www.gfi.com/blog/?p=990</guid>
		<description><![CDATA[One of the most thoroughly used functions on Windows Servers is Active Directory. This can literally hold all information about your users, your corporate organization and corporate contact information. This data is invaluable, and is constantly changing, so keeping it &#8230;]]></description>
			<content:encoded><![CDATA[<p><a class="lightbox" title="CSVDE" href="http://www.gfi.com/blog/wp-content/uploads/2009/09/CSVDE.jpg"><img class="alignright size-medium wp-image-1011" style="margin: 10px; border: 0px;" title="CSVDE" src="http://www.gfi.com/blog/wp-content/uploads/2009/09/CSVDE-300x189.jpg" alt="" width="300" height="189" /></a>One of the most thoroughly used functions on Windows Servers is Active Directory. This can literally hold all information about your users, your corporate organization and corporate contact information. This data is invaluable, and is constantly changing, so keeping it documented and up to date is often a tedious task which consumes a lot of resources. What if you could export this data, and manipulate it in spreadsheets? If your job involves working with Active Directory you will find that there is a command line tool designed precisely for this purpose, and it is really easy to use.</p>
<h2><span id="more-990"></span>What is CSVDE and why should I use it?</h2>
<p>Comma Separated Value Data Exchange (CSVDE) actually comes built-in Windows 2003 Server installations (normally in %windir%/system32 directory). A comma-separated value (CSV) file is usually a plain text file, with the data contained in rows and columns separated by commas (,). This makes it relatively easy to decipher and most common spreadsheet applications (such as Microsoft Excel or OpenOffice Calc) can open it without making any modifications to the file and display it organized neatly in rows and columns.</p>
<p>CSVDE can be used both to export data about a current Active Directory Configuration, the easiest thing that will in no way effect your working configuration, and to import data into a new installation of Active Directory, which is not recommended unless you are doing so on a test setup or is closely familiar with the intricacies of CSVDE. When importing data using CSVDE, it will directly affect your system since data is being added and manipulated. Ideally this should be first tried out in a test scenario which does not affect a live installation.</p>
<p>In the next article we will discuss <a href="http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-2/">how to export data from Active Directory and how to import it in Microsoft Excel using CSVDE </a>as well as touch on some basic data manipulation commands. Finally in the last part, we will also discuss how to create a template using an Excel worksheet, create a CSV file and how to import data into Active Directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gfi.com/blog/csvde-means-simplify-active-directory-administration-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

