<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Getting IT Right &#187; Active Directory</title>
	<atom:link href="http://blog.meteorit.co.uk/tag/active-directory/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.meteorit.co.uk</link>
	<description>the unofficial voice of Meteor IT</description>
	<lastBuildDate>Sun, 12 Feb 2012 23:21:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.meteorit.co.uk' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/f20aaf2e5a61cd42fe07e67a0f2a1c3f?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Getting IT Right &#187; Active Directory</title>
		<link>http://blog.meteorit.co.uk</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.meteorit.co.uk/osd.xml" title="Getting IT Right" />
	<atom:link rel='hub' href='http://blog.meteorit.co.uk/?pushpress=hub'/>
		<item>
		<title>Want to know more about your users? Use AcctInfo to get extra AD information</title>
		<link>http://blog.meteorit.co.uk/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/</link>
		<comments>http://blog.meteorit.co.uk/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 19:49:46 +0000</pubDate>
		<dc:creator>Adam Vero</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Utilities + Tools]]></category>
		<category><![CDATA[acctinfo]]></category>
		<category><![CDATA[ADUC]]></category>
		<category><![CDATA[password expiry]]></category>
		<category><![CDATA[reset password]]></category>
		<category><![CDATA[user account]]></category>

		<guid isPermaLink="false">http://veroblog.wordpress.com/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/</guid>
		<description><![CDATA[AcctInfo gives you Active Directory properties at a glance. AcctInfo is a dll file which is part of the free tools for the Windows 2003 resource kit, but can be used on 2003 or 2000 machines. It enables extended properties for the Active Directory Users and Computers (ADUC) MMC snapin. This is one of those [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.meteorit.co.uk&amp;blog=646149&amp;post=110&amp;subd=veroblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>AcctInfo gives you Active Directory properties at a glance.</h2>
<p>AcctInfo is a dll file which is part of the free tools for the Windows 2003 resource kit, but can be used on 2003 or 2000 machines. It enables extended properties for the Active Directory Users and Computers (ADUC) MMC snapin.</p>
<p>This is one of those tools which is really useful, if only you knew it was available. Then of course you have to get round to installing it on all the machines where you might need to use it. However, once you have started using it you will be very pleased that you bothered.</p>
<p><span id="more-110"></span><br />
The extra AD information simply appears as an additional tab in a user&#8217;s properties (see screenshot, click to enlarge it).</p>
<p><a href="http://veroblog.files.wordpress.com/2007/09/acctinfo-properties.png"><img src="http://veroblog.files.wordpress.com/2007/09/acctinfo-properties-thumb.png?w=211&#038;h=274" style="border-width:0;margin:0 5px 0 20px;" alt="AcctInfo_Properties_Tab" align="right" border="0" height="274" width="211" /></a>These properties include information such as:</p>
<ul>
<li>when the password was last changed and when it expires (date and time plus how far away that is to save calculating)</li>
<li>a button to see the policies in force relating to passwords</li>
<li>the user account SID and GUID, and a button to see SID history (if the account has been migrated in from another domain)</li>
<li>when they last logged on and off, or had a failed logon attempt (at the DC you are using to look at the information)</li>
<li>Their total logon count as well as the current bad password count (relevant only if you have a password lockout policy)</li>
</ul>
<p>There is also a button which enables you to reset the user&#8217;s password on a DC in the site where the user is currently working (more about this later).</p>
<h2>Where do I get it? How do I install it?</h2>
<p>First <a href="http://download.microsoft.com/download/8/e/c/8ec3a7d8-05b4-440a-a71e-ca3ee25fe057/rktools.exe" title="Download Windows 2003 resource Kit tools (exe file link)" target="_blank">download the free tools for the Windows Server 2003 Resource Kit</a> (12Mb exe file) and install them. By installing the resource kit so that other tools are already there when you need them, and you may find something useful which you did not even know existed. Serendipity can often be the best way to find which tools work for you and which are unnecessary.</p>
<p>Now you have downloaded it you need to register the DLL, so you need to know where it is. After installing the Resource Kit tools it will be here by default: C:\Program Files\Windows Resource Kits\Tools\Acctinfo.dll</p>
<p>You can choose to copy the DLL file to somewhere else such as c:\windows\system32 but you don&#8217;t need to (you can also copy the single file to a memory stick ready to put onto other machines without the hassle of installing the whole resource kit).</p>
<p>Either way, you need to use regsvr32 to register the dll file using the following as an example:</p>
<p><em>regsvr32 &#8220;C:\Program Files\Windows Resource Kits\Tools\Acctinfo.dll&#8221;</em></p>
<p><em><a href="http://veroblog.files.wordpress.com/2007/09/acctinfo-dll-registration.png"><img src="http://veroblog.files.wordpress.com/2007/09/acctinfo-dll-registration-thumb.png?w=338&#038;h=84" style="border-width:0;margin:0 5px 0 15px;" alt="AcctInfo DLL registration success" align="right" border="0" height="84" width="338" /></a></em>The quotes deal with the spaces in the path. To unregister it you would use <em>regsvr32 /u acctinfo.dll</em> &#8211; no need for the full path.</p>
<p>You should see something like the screenshot on the right.</p>
<p>Now when you use ADUC and go to a user account properties (right click &gt; properties or however you prefer) you will have the extra tab, labelled &#8220;Additional Account Info&#8221; (as shown above).</p>
<blockquote><p>Note that this does <em>not </em>work if you are using Small Business Server&#8217;s built-in all-in-one server management tool, but it works just as it should when you run ADUC as a normal MMC snap-in on SBS. It seems really odd that this should be the case, but there it is.</p>
<p>Similarly, it won&#8217;t show the extra tab if you get to the user using the &#8220;find&#8221; function in ADUC and opening the properties from a user listed in the results, because this goes via dsquery.dll. It does show up if you double click a user listed in the &#8220;members&#8221; of a group, though, which does not. Inconsistent? (Thanks to <a href="http://www.security-forums.com/viewtopic.php?t=49707" title="SecurityForums thread about AcctInfo.dll" target="_blank">Windude in this thread at SecurityForums.com</a> for pointing out that it fails from a Find results list.)</p></blockquote>
<h2>What additional account information is now available?</h2>
<h3>Password expiry and policies</h3>
<p>The first cluster of details are about the users&#8217; password &#8211; when they last changed it and when it expires, and very helpfully how far into the future this is to save having to calculate &#8211; &#8220;will my password expire while I am away on holiday for two weeks?&#8221;. There is also a button labelled &#8220;Domain PW info&#8221; which brings up a message box with information about the password policy currently in force on the domain, as shown below.</p>
<p>There are a couple of anomalies to watch for here, highlighted in the image below (click to enlarge).</p>
<p><a href="http://veroblog.files.wordpress.com/2007/09/acctinfo-domainpasswordpolicy.png"><img src="http://veroblog.files.wordpress.com/2007/09/acctinfo-domainpasswordpolicy-thumb.png?w=288&#038;h=108" style="border-width:0;margin:5px 5px 0 15px;" alt="AcctInfo_DomainPasswordPolicy" align="right" border="0" height="108" width="288" /></a>If you set a password lockout policy and then change your mind later, it still remembers the lockout duration and time to reset the bad password count to zero if not exceeded. They don&#8217;t do anything but may confuse you if you don&#8217;t spot the &#8220;Cannot be locked out&#8221;. Incidentally, it handles multiple policies applied at domain level correctly, taking link order into account correctly (as you would hope and expect).</p>
<p>There also seems to be a delay sometimes for password policy changes to show up correctly here (I&#8217;m using a domain with a single domain controller for this, so there should be no replication latency). Updating policies on the box you are running ADUC on or against seems to make no difference. This is not a major issue as things are only changed very infrequently, just be aware of it. To check your policies, use GPMC, only rely on this tool to give you a quick way to check if you are fairly sure they will not have been touched for while.</p>
<p>Don&#8217;t forget, password policies may be different between domains, so be sure you are connecting to a DC in the right domain of the forest (I have not confirmed what happens if you use the tool on one DC in domain a.z.com to look at a user in domain b.z.com &#8211; it ought to check the domain the user object is in, but you need to verify for yourself that is the case or make sure you change the focus of ADUC first (right click the root where it says &#8220;Active Directory Users and Computers&#8221; and choose connect to domain / domain controller.</p>
<h3>SID information</h3>
<p>The user&#8217;s SID and GUID are shown, which may be useful for some troubleshooting tasks, or if you need to use them in a script in preference to an FQDN (perhaps if you are worried the user object may get moved later or their OU renamed).</p>
<p>The SIDHistory attribute will only be populated for accounts which have been brought into the domain as part of a migration using a utility such as the <a href="http://technet2.microsoft.com/windowsserver/en/library/e70c3799-22e0-4385-8b36-f6f00b9c2f9b1033.mspx?mfr=true" title="ADMT Technet article" target="_blank">Active Directory Migration Tool (ADMT)</a>. This is used to provide access to resources in the source domain, including legacy systems such as Exchange 5.5.</p>
<h3>Details about previous logons</h3>
<p>The next area gives information about when the user last logged on and off, or had a failed logon attempt. It also shows the current bad logon count so you can see if that means their next attempt would cause a lockout (or already has done), if you are using this as a policy.</p>
<p><strong>Note: </strong>these times are no different from what you get any other way in AD (such as DSQuery) &#8211; in other words it gives the last logon or logoff which took place using that particular domain controller. It does not aggregate these across the domain, so it may seem that the user has not logged on for some time if they have been successfully authenticating against another DC. Do not rely on this information alone to decide whether an account should be disabled as being out of use.</p>
<h3>Set Password on Site DC</h3>
<p>Rather than have to change the focus of ADUC (which collapses the tree view of the domain structure), you can use this feature to reset a user&#8217;s password directly against a domain controller on the user&#8217;s site.</p>
<p><a href="http://veroblog.files.wordpress.com/2007/09/acctinfo-pwchangeonsite.png"><img src="http://veroblog.files.wordpress.com/2007/09/acctinfo-pwchangeonsite-thumb.png?w=338&#038;h=148" style="margin:5px 15px 0 5px;" alt="Change password on user's site dialogue box" align="left" height="148" width="338" /></a>You enter the computer name of the machine they are sat in front of &#8211; they can see the computer name in the dropdown box for the domain in the logon box if you don&#8217;t have physical labels on machines. Give it a password and confirm a second time, force the user to change after the next logon (if you so choose) and unlock the account at the same time (if it is locked, otherwise this is understandably greyed out).</p>
<p>You can choose to just identify the site and tell you which DC it <em>would</em> use without actually setting the password by using the &#8220;Just find site&#8221; button. Be careful here &#8211; if you click &#8220;OK&#8221; instead and the password fields are empty, this will immediately reset the password to be blank, if that is allowed by your policy. If the password you give is not compliant with your domain policies it will not be permitted, you get an error and another chance.</p>
<h2>What are you waiting for?</h2>
<p>It&#8217;s simple, it plugs in to your existing MMC tools and adds some very useful features. You won&#8217;t use this every day (unless you man a very busy helpdesk) but when you do need to get this information in a hurry or want to unlock a user and reset their password in one go, this just gets the job done.</p>
<p><span class="sbmLink"></span></p>
<table cellpadding="1" cellspacing="1">
<tr>
<td class="sbmText">Share this post :</td>
<td class="sbmDim"><a href="http://del.icio.us/post?url=http://veroblog.wordpress.com/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/&amp;;title=Use%20AcctInfo%20to%20get%20extra%20AD%20user%20account%20information%20such%20as%20password%20expiry" class="sbmDim" title="Post it to del.icio.us" target="_blank"><img src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliciou4.png" border="0" /></a></td>
<td class="sbmDim"><a href="http://de.lirio.us/bookmarks/sbmtool?action=add&amp;address=http://veroblog.wordpress.com/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/&amp;title=Use%20AcctInfo%20to%20get%20extra%20AD%20user%20account%20information%20such%20as%20password%20expiry" class="sbmDim" title="Post it to del.iri.ous!" target="_blank"><img src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliriou4.png" border="0" /></a></td>
<td class="sbmDim"><a href="http://digg.com/submit?phase=2&amp;url=http://veroblog.wordpress.com/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/&amp;title=Use%20AcctInfo%20to%20get%20extra%20AD%20user%20account%20information%20such%20as%20password%20expiry" class="sbmDim" title="Post it to digg" target="_blank"><img src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/digg14.png" border="0" /></a></td>
<td class="sbmDim"><a href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;mkt=en-us&amp;url=http://veroblog.wordpress.com/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/&amp;title=Use%20AcctInfo%20to%20get%20extra%20AD%20user%20account%20information%20such%20as%20password%20expiry" class="sbmDim" title="Post it to live" target="_blank"><img src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/live4.png" border="0" /></a></td>
<td class="sbmDim"><a href="http://reddit.com/submit?url=http://veroblog.wordpress.com/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/&amp;title=Use%20AcctInfo%20to%20get%20extra%20AD%20user%20account%20information%20such%20as%20password%20expiry" class="sbmDim" title="Post it to reddit!" target="_blank"><img src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/reddit4.png" border="0" /></a></td>
<td class="sbmDim"><a href="http://technorati.com/faves/?add=http://veroblog.wordpress.com/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/&amp;title=Use%20AcctInfo%20to%20get%20extra%20AD%20user%20account%20information%20such%20as%20password%20expiry" class="sbmDim" title="Post it to technorati!" target="_blank"><img src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/technora4.png" border="0" /></a></td>
<td class="sbmDim"><a href="http://myweb.yahoo.com/myresults/bookmarklet?u=http://veroblog.wordpress.com/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/&amp;t=Use%20AcctInfo%20to%20get%20extra%20AD%20user%20account%20information%20such%20as%20password%20expiry" class="sbmDim" title="Post it to yahoo!" target="_blank"><img src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/yahoo9.png" border="0" /></a></td>
</tr>
</table>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/veroblog.wordpress.com/110/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/veroblog.wordpress.com/110/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/veroblog.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/veroblog.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/veroblog.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/veroblog.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/veroblog.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/veroblog.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/veroblog.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/veroblog.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/veroblog.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/veroblog.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/veroblog.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/veroblog.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/veroblog.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/veroblog.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.meteorit.co.uk&amp;blog=646149&amp;post=110&amp;subd=veroblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.meteorit.co.uk/2007/09/17/want-to-know-more-about-your-users-use-acctinfo-to-get-extra-ad-information/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/786403437a56d6c7ecd26e885004d2ad?s=96&#38;d=wavatar&#38;r=PG" medium="image">
			<media:title type="html">AdamV</media:title>
		</media:content>

		<media:content url="http://veroblog.files.wordpress.com/2007/09/acctinfo-properties-thumb.png" medium="image">
			<media:title type="html">AcctInfo_Properties_Tab</media:title>
		</media:content>

		<media:content url="http://veroblog.files.wordpress.com/2007/09/acctinfo-dll-registration-thumb.png" medium="image">
			<media:title type="html">AcctInfo DLL registration success</media:title>
		</media:content>

		<media:content url="http://veroblog.files.wordpress.com/2007/09/acctinfo-domainpasswordpolicy-thumb.png" medium="image">
			<media:title type="html">AcctInfo_DomainPasswordPolicy</media:title>
		</media:content>

		<media:content url="http://veroblog.files.wordpress.com/2007/09/acctinfo-pwchangeonsite-thumb.png" medium="image">
			<media:title type="html">Change password on user&#039;s site dialogue box</media:title>
		</media:content>

		<media:content url="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliciou4.png" medium="image" />

		<media:content url="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliriou4.png" medium="image" />

		<media:content url="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/digg14.png" medium="image" />

		<media:content url="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/live4.png" medium="image" />

		<media:content url="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/reddit4.png" medium="image" />

		<media:content url="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/technora4.png" medium="image" />

		<media:content url="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/yahoo9.png" medium="image" />
	</item>
		<item>
		<title>Using DSMod to update Active Directory</title>
		<link>http://blog.meteorit.co.uk/2007/01/01/using-dsmod-to-update-many-active-directory-objects-at-once/</link>
		<comments>http://blog.meteorit.co.uk/2007/01/01/using-dsmod-to-update-many-active-directory-objects-at-once/#comments</comments>
		<pubDate>Mon, 01 Jan 2007 10:39:57 +0000</pubDate>
		<dc:creator>Adam Vero</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[DSGet]]></category>
		<category><![CDATA[DSMod]]></category>
		<category><![CDATA[DSQuery]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[user account]]></category>
		<category><![CDATA[user details]]></category>
		<category><![CDATA[windows server]]></category>

		<guid isPermaLink="false">http://veroblog.wordpress.com/2007/01/01/using-dsmod-to-update-many-active-directory-objects-at-once/</guid>
		<description><![CDATA[DSMOD foundation course 101 I originally wrote this as an email reply to a colleague&#8217;s question about updating many Active Directory objects in one go, and later thought I could write it up &#8220;tutorial style&#8221;. I still think the DSQuery, DSGet, DSMod functions are underused by even fairly knowledgeable administrators, so here is a beginner&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.meteorit.co.uk&amp;blog=646149&amp;post=4&amp;subd=veroblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>DSMOD foundation course 101</strong></p>
<p>I originally wrote this as an email reply to a colleague&#8217;s question about updating many Active Directory objects in one go, and later thought I could write it up &#8220;tutorial style&#8221;. I still think the DSQuery, DSGet, DSMod functions are underused by even fairly knowledgeable administrators, so here is a beginner&#8217;s guide to getting the most of these tools.</p>
<p>This is intended to show the principles for changing many AD objects&#8217; properties in one go. There are lots more clever things you could do with this &#8211; like a lot of command line stuff, the principles are very simple but can be strung together to very powerful end results with a bit of thought and a step-by-step logical approach.</p>
<p>Basically, DSMOD allows you to change many (not all) of the AD properties of an object, usually a user, computer or group. This tutorial discusses users specifically, but the principles extend to other objects.<span id="more-4"></span></p>
<p>It uses the full canononical name for the object ie &#8220;CN=Eliza Doolittle, OU=etc.&#8221; but you don&#8217;t need to worry about that. The way to use it in practice is by using dsquery to do a &#8220;search&#8221; (even if this is for only one object) and pipe the returned results to dsmod, where you change one or more properties of that object.</p>
<p>First try something with dsquery:</p>
<blockquote><p>dsquery user -name Chris* &#8220;OU=Building 1, dc=internal,dc=mycompany,dc=co,dc=uk&#8221;</p></blockquote>
<p>This should give you several results for everyone whose common name matches Chris* (* as wildcard as usual, note that this also matches zero characters so *Chris* would also return these same results even though there is nothing in front of the &#8220;Chris&#8221;, but would also find &#8220;John Christopher&#8221; if he existed)</p>
<p>We can now find users who match certain criteria. Then we can pass the results straight into dsmod to modify the properties. A simple example:</p>
<blockquote><p>dsquery user -samid JHC &#8220;OU=Building 2, dc=internal,dc=mycompany,dc=co,dc=uk&#8221; | dsmod user -tel &#8220;555 &#8211; 112 233&#8243; -u AdminUser -p AdminPassword</p></blockquote>
<p>translation:</p>
<blockquote><p>dsquery &lt;object type = user&gt; where &lt;SAM account&gt; = JHC, in the OU &#8230;(must be full canononical form) pipe the answer into a</p></blockquote>
<blockquote><p>dsmod and modify this &lt;object type = user&gt; &lt;property of object: &#8220;telephone number&#8221;&gt; to be &#8220;555 etc&#8221; &lt;using admin account AdminUser&gt; &lt;password APassword&gt;</p></blockquote>
<p>So, get the CN of this user, then change their telephone number to X. Simple. (By the way your Outlook web access users will love this &#8211; they can get at the internal directory securely, just by looking at the properties of a user in the Address Book, then call someone directly. You could claim you spent all weekend typing in these numbers and get the overtime as well, as long as your PHB does not read this!)</p>
<p>For these kinds of changes where there are lots of unique ones I would usually expect to be using some kind of source list and using excel (or whatever you prefer) to parse the bits together into commands, then copy and paste out to notepad (not even bothering to save as CSV, notepad is dumb enough to just take the results regardless). You can paste straight to a command line, but my general recommendation is always write these as batch files, this way they are easier to edit and re-use, and you can keep exact copies of what you have done as change-control records. This is really useful if you screw up and need to undo (ie overwrite) anything, like changing everyone&#8217;s phone number to the same thing or something equally daft (I&#8217;m admitting nothing at this point!). At least you can see what has been done and know what to change back.</p>
<p>You don&#8217;t need a user name and password if you are running the command window with sufficient privileges. I tend to run the command window with my normal account so I include the admin account details in the command for simplicity.</p>
<p>You need quotes around entries if they contain spaces (in the above example this is true for the OU &#8220;Building 2&#8243; and the telephone number entry. If this was HeadOffice and just the extension number, quotes not required. As far as I can tell, it is all case-INsensitive.</p>
<p>Slightly more advanced example, doing many users at once, let&#8217;s say to change user passwords to enable IT staff to set up profiles for them in a new domain during a weekend office move and migration:</p>
<blockquote><p>dsquery user &#8220;OU=Sales,OU=New York,dc=internal,dc=AcmeCorp,dc=com&#8221; | dsmod user -pwd ChangeThisNow! -u Admin -p APassword</p></blockquote>
<p>This would change password of all users in Sales in New York to &#8220;ChangeThisNow!&#8221;.<br />
Note: the dsquery will return matching objects anywhere in the OU you specify, or further down the OU structure. So, if you start from New York you will get everyone in New York &#8211; I would suggest you do it team by team (ish) to avoid changing things like IT staff or service accounts etc.</p>
<p>Having done that you now have everyone that you want with a changed password. On Sunday night you would possibly want to use:</p>
<blockquote><p>dsquery user &#8220;OU=Sales,OU=New York,dc=internal,dc=AcmeCorp,dc=com&#8221; -limit 300 | dsmod user -mustchpwd yes</p></blockquote>
<p>to force them all to change at next login.</p>
<p>You might also want</p>
<blockquote><p>dsquery user &#8220;OU=Sales,OU=New York,dc=internal,dc=AcmeCorp,dc=com&#8221; -limit 300 | dsmod user -office &#8220;New Building 3&#8243;</p></blockquote>
<p>Note the use of &#8220;-limit 300&#8243; &#8211; default limit is to return 100 results, useful when you are just doing the dsquery on it&#8217;s own to make sure you have the syntax correct. If you miss this off it will do the first 100 and stop, so if you expect more results use this switch at a reasonable level (300, 1000, 100000?)</p>
<p>To get useful help files you can just do the usual /?<br />
eg dsmod /?<br />
or dsmod user /?<br />
or dsquery computer /?<br />
I tend to redirect the output to text files for convenience (they are quite detailed).</p>
<p>DSGET is also useful to get the properties in the first place (perhaps to use in Excel to parse a new batch file together), so use &#8220;dsquery | dsget &#8221; approach to find eg all SAM ID&#8217;s for Sales, or all their email addresses or whatever.</p>
<p>Summary of the most useful (I have found) user properties :<br />
pwd == user password<br />
mustchpwd == force change of password after next logon<br />
tel == telephone number<br />
samid == we know this is domain-unique so it&#8217;s a good start point<br />
profile == path to profile *<br />
hmdir == path to home directory *<br />
hmdrv == drive letter for home directory<br />
fn == first name #<br />
ln == last name #<br />
office == Office location, building name, whatever makes sense in your organisation</p>
<p><strong>*</strong>The wildcard $username$ can be used to insert the SAM id for the -profile or -hmdir parameter. Note the $, rather than % as you would get in a DOS command using an environmental variable</p>
<blockquote><p>dsquery user &#8220;OU=Sales,OU=New York,dc=internal,dc=AcmeCorp,dc=com&#8221; | dsmod user -hmdir \\internal\DfsRoot\homes\$username$ -hmdrv u:</p></blockquote>
<p><strong>#</strong>eg I will use dsget to do an export of samid, lastname and firstname, then in Excel strip the first initial of the first name and use it with surname to lookup this against the telephone list supplied by the Facilities / reception team which only has surname.initial. From there I can create the script to change the telephone number entries. What I would probably do in practice is change ALL New York user telephone numbers to &#8220;unknown&#8221;, then change the ones my script can match perfectly, then we can do a query for all users whose telephone number is still &#8220;unknown&#8221; and do these by hand (eg where their first name Elizabeth is in the phone system as &#8220;B&#8221; for Beth, and for spelling errors etc.)</p>
<p>Very frustrating thing to watch out for, the syntax and names for the properties in dsquery, dsget and dsmod are not identical, eg in dsquery there is no syntax to search for first name alone, you have to use a wildcard-based mask, but having found them you can&#8217;t write directly back to the name, you have to write to first name, surname or display name as required. This is another reason to use batch files &#8211; when it doesn&#8217;t work because the syntax is wrong you can more easily change it and re-run.</p>
<p>Have fun! (?) I would reckon the amount of time you spend learning this just for any one-off exercise of changing all the passwords or telephone numbers will pay for itself straight away. You then get to reap more rewards down the line for free!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/veroblog.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/veroblog.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/veroblog.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/veroblog.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/veroblog.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/veroblog.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/veroblog.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/veroblog.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/veroblog.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/veroblog.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/veroblog.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/veroblog.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/veroblog.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/veroblog.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/veroblog.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/veroblog.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.meteorit.co.uk&amp;blog=646149&amp;post=4&amp;subd=veroblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.meteorit.co.uk/2007/01/01/using-dsmod-to-update-many-active-directory-objects-at-once/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/786403437a56d6c7ecd26e885004d2ad?s=96&#38;d=wavatar&#38;r=PG" medium="image">
			<media:title type="html">AdamV</media:title>
		</media:content>
	</item>
	</channel>
</rss>
