<?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>Who... What... Where... &#187; LDAP</title>
	<atom:link href="http://www.yeltuor.com/articles/tag/ldap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yeltuor.com</link>
	<description>General things I find interesting</description>
	<lastBuildDate>Sun, 02 Aug 2009 09:58:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Active Directory LDAP</title>
		<link>http://www.yeltuor.com/reference/active-directory-ldap-attributes/</link>
		<comments>http://www.yeltuor.com/reference/active-directory-ldap-attributes/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 20:07:21 +0000</pubDate>
		<dc:creator>shane</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://www.yeltuor.com/?page_id=98</guid>
		<description><![CDATA[Below are a series of tables that show a mapping of Active Directory attributes to there LDAP counter parts



AD User Attribute
LDAP Attribute


Name
cn


General



First name
givenName


Initials
initials


Last name
sn


Display name
displayName


Description
description


Office
physicalDeliveryOfficeName


Telephone number
telephoneNumber


Other Telephone numbers
otherTelephone


E-mail
mail


Web page
wWWHomePage


Other Web pages
url


Address



Street
streetAddress


P.O. Box
postOfficeBox


City
l


State/province
st


Zip/Postal Code
postalCode


Country/region
c, co, countryCode


Account



User logon name
userPrincipalName


pre-Windows 2000 logon name
sAMAccountName


Account disabled
userAccountControl


User must change password at next logon
pwdLastSet


Account expires end of (date)
accountExpires


Profile



User Profile path
profilePath


Logon script
scriptPath


Home folder, [...]]]></description>
			<content:encoded><![CDATA[<p>Below are a series of tables that show a mapping of Active Directory attributes to there LDAP counter parts</p>
<table border="0" cellspacing="0" cellpadding="0" width="500">
<tbody>
<tr>
<td width="200"><strong>AD User Attribute</strong></td>
<td><strong>LDAP Attribute</strong></td>
</tr>
<tr>
<td>Name</td>
<td>cn</td>
</tr>
<tr>
<td><strong>General</strong></td>
<td></td>
</tr>
<tr>
<td>First name</td>
<td>givenName</td>
</tr>
<tr>
<td>Initials</td>
<td>initials</td>
</tr>
<tr>
<td>Last name</td>
<td>sn</td>
</tr>
<tr>
<td>Display name</td>
<td>displayName</td>
</tr>
<tr>
<td>Description</td>
<td>description</td>
</tr>
<tr>
<td>Office</td>
<td>physicalDeliveryOfficeName</td>
</tr>
<tr>
<td>Telephone number</td>
<td>telephoneNumber</td>
</tr>
<tr>
<td>Other Telephone numbers</td>
<td>otherTelephone</td>
</tr>
<tr>
<td>E-mail</td>
<td>mail</td>
</tr>
<tr>
<td>Web page</td>
<td>wWWHomePage</td>
</tr>
<tr>
<td>Other Web pages</td>
<td>url</td>
</tr>
<tr>
<td><strong>Address</strong></td>
<td></td>
</tr>
<tr>
<td>Street</td>
<td>streetAddress</td>
</tr>
<tr>
<td>P.O. Box</td>
<td>postOfficeBox</td>
</tr>
<tr>
<td>City</td>
<td>l</td>
</tr>
<tr>
<td>State/province</td>
<td>st</td>
</tr>
<tr>
<td>Zip/Postal Code</td>
<td>postalCode</td>
</tr>
<tr>
<td>Country/region</td>
<td>c, co, countryCode</td>
</tr>
<tr>
<td><strong>Account</strong></td>
<td></td>
</tr>
<tr>
<td>User logon name</td>
<td>userPrincipalName</td>
</tr>
<tr>
<td>pre-Windows 2000 logon name</td>
<td>sAMAccountName</td>
</tr>
<tr>
<td>Account disabled</td>
<td>userAccountControl</td>
</tr>
<tr>
<td>User must change password at next logon</td>
<td>pwdLastSet</td>
</tr>
<tr>
<td>Account expires end of (date)</td>
<td>accountExpires</td>
</tr>
<tr>
<td><strong>Profile</strong></td>
<td></td>
</tr>
<tr>
<td>User Profile path</td>
<td>profilePath</td>
</tr>
<tr>
<td>Logon script</td>
<td>scriptPath</td>
</tr>
<tr>
<td>Home folder, local path</td>
<td>homeDirectory</td>
</tr>
<tr>
<td>Home folder, Connect, Drive</td>
<td>homeDrive</td>
</tr>
<tr>
<td>Home folder, Connect, To:</td>
<td>homeDirectory</td>
</tr>
<tr>
<td><strong>Telephones</strong></td>
<td></td>
</tr>
<tr>
<td>Home</td>
<td>homePhone</td>
</tr>
<tr>
<td>Other Home phone numbers</td>
<td>otherHomePhone</td>
</tr>
<tr>
<td>Pager</td>
<td>pager</td>
</tr>
<tr>
<td>Mobile</td>
<td>mobile</td>
</tr>
<tr>
<td>Fax</td>
<td>facsimileTelephoneNumber</td>
</tr>
<tr>
<td>Notes</td>
<td>info</td>
</tr>
<tr>
<td><strong>Organization</strong></td>
<td></td>
</tr>
<tr>
<td>Title</td>
<td>title</td>
</tr>
<tr>
<td>Department</td>
<td>department</td>
</tr>
<tr>
<td>Company</td>
<td>company</td>
</tr>
<tr>
<td>Manager</td>
<td>manager</td>
</tr>
</tbody>
</table>
<p>Object class “computer”</p>
<table border="0" cellspacing="0" cellpadding="0" width="500">
<tbody>
<tr>
<td><strong>AD Computer Attribute</strong></td>
<td width="200"><strong>LDAP Attribute</strong></td>
</tr>
<tr>
<td>Name</td>
<td>cn</td>
</tr>
<tr>
<td>Location<strong><br />
</strong></td>
<td>location</td>
</tr>
<tr>
<td>Description</td>
<td>description</td>
</tr>
<tr>
<td>Operating System Version</td>
<td>operatingSystem</td>
</tr>
<tr>
<td>OS Service Pack</td>
<td>operatingSystemServicePack</td>
</tr>
<tr>
<td>Group Membership</td>
<td>memberOf</td>
</tr>
</tbody>
</table>
<p>Object class “group”</p>
<table border="0" cellspacing="0" cellpadding="0" width="500">
<tbody>
<tr>
<td width="200"><strong>AD Group Attribute</strong></td>
<td><strong>LDAP Attribute</strong></td>
</tr>
<tr>
<td>Name</td>
<td>cn</td>
</tr>
<tr>
<td>Member of Group<strong><br />
</strong></td>
<td>member</td>
</tr>
<tr>
<td>Description</td>
<td>description</td>
</tr>
<tr>
<td>Group Type (global/universal/security)</td>
<td>instanceType</td>
</tr>
</tbody>
</table>

	Tags: <a href="http://www.yeltuor.com/articles/tag/active-directory/" title="Active Directory" rel="tag">Active Directory</a>, <a href="http://www.yeltuor.com/articles/tag/ldap/" title="LDAP" rel="tag">LDAP</a>, <a href="http://www.yeltuor.com/articles/tag/reference/" title="reference" rel="tag">reference</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.yeltuor.com/reference/active-directory-ldap-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VB Query Active Directory Objects</title>
		<link>http://www.yeltuor.com/articles/script/vb-query-active-directory-objects/</link>
		<comments>http://www.yeltuor.com/articles/script/vb-query-active-directory-objects/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 19:56:58 +0000</pubDate>
		<dc:creator>shane</dc:creator>
				<category><![CDATA[Scripting Snippets]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.yeltuor.com/?p=89</guid>
		<description><![CDATA[In an Active Directory environment there is often a requirement to query objects within the AD  database, either returning selected attribute values or using this information to for further queries.
The same principles apply across any object type, the script below connects via LDAP, performs a query and returns selected values from Active Directory.
The below script [...]]]></description>
			<content:encoded><![CDATA[<p>In an Active Directory environment there is often a requirement to query objects within the AD  database, either returning selected attribute values or using this information to for further queries.</p>
<p>The same principles apply across any object type, the script below connects via LDAP, performs a query and returns selected values from Active Directory.</p>
<p>The below script will query all objects in the OU <em>MyServers</em> and subtree, in the domain <em>Domain.co.uk</em>, of type <em>computer</em>, returning the attributes <em>Name </em>and <em>Location</em>.</p>
<blockquote><p>Const ADS_SCOPE_SUBTREE = 2</p>
<p>Set objConnection = CreateObject(”ADODB.Connection”)<br />
Set objCommand = CreateObject(”ADODB.Command”)<br />
objConnection.Provider = “ADsDSOObject”<br />
objConnection.Open “Active Directory Provider”</p>
<p>Set objCOmmand.ActiveConnection = objConnection<br />
objCommand.CommandText = “Select Name, Location from ‘LDAP://OU=MyServers,DC=Domain,DC=co,DC=uk’ ” &amp; “Where objectClass=’computer’”<br />
objCommand.Properties(”Page Size”) = 1000<br />
objCommand.Properties(”Searchscope”) = ADS_SCOPE_SUBTREE<br />
Set objRecordSet = objCommand.Execute<br />
objRecordSet.MoveFirst<br />
Do Until objRecordSet.EOF</p>
<p>‘ Insert Operators here<br />
objRecordSet.MoveNext</p>
<p>Loop</p></blockquote>
<p>Once the query has been run the results can then be used for any requirement, a simple example below is to display  the name of the computer followed by the Location attribute stored in AD.</p>
<blockquote><p>……<br />
Do Until objRecordSet.EOF</p>
<p>‘ Insert Operators here<br />
Wscript.Echo “Computer Name: ” &amp; objRecordSet.Fields(”Name”).Value<br />
Wscript.Echo “Location: ” &amp; objRecordSet.Fields(”Location”).Value</p>
<p>objRecordSet.MoveNext<br />
Loop</p></blockquote>
<p>Any attribute of the object can be displayed as long as it was requested in the initial query; <em>Select Name, Location from….</em> , attribute names are LDAP attributes rather than field names seen in the Active Directory Users and Computers mmc. A list of attributes can be found here; <a href="http://www.yeltuor.com/reference/active-directory-ldap-attributes/">Active Directory LDAP Attributes</a></p>
<p>One way to enhance this script further is for each computer selected perform a WMI query against it; <a href="http://www.yeltuor.com/">VB WMI Query</a></p>

	Tags: <a href="http://www.yeltuor.com/articles/tag/active-directory/" title="Active Directory" rel="tag">Active Directory</a>, <a href="http://www.yeltuor.com/articles/tag/ldap/" title="LDAP" rel="tag">LDAP</a>, <a href="http://www.yeltuor.com/articles/tag/vb/" title="VB" rel="tag">VB</a>, <a href="http://www.yeltuor.com/articles/tag/windows/" title="Windows" rel="tag">Windows</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.yeltuor.com/articles/script/vb-query-active-directory-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
