Function: Parse Object Name from Path

The following function will allow you to pull an object name from a path:

Example: LDAP:\\CN=JSMITH, OU=USERS, DC=DOMAIN, DC=COM

The function will return JSMITH. This may not seem very useful at first, and I created it only after I was unable to return results of anthing but the path. This is also useful in scripts that need both the path and the object name and can be used to remove the need for multiple queries. Function posted after the break.

Continue reading Function: Parse Object Name from Path…

Active Directory – Page Pool Size

Have you ever created a script that wouldn’t return all of the results you expected? Often times this is caused by a default Active Directory value (MaxPageSize). Initially this value is set to 1000, so when you query Active Directory only 1000 results will be returned. You can change this value through ntdsutil.exe but I recommend the following.

When configuring your ADODB command use the following property:

    objCommand.Properties(”Page Size”) = 10000

As you can see I set the Page Size value to 10000 because I know that the Active Directory I’m pulling values from will never return more than 10000. You can set this depending on the size of your environment, or to the maxint value if you’re not sure. An example follows the break.

Continue reading Active Directory – Page Pool Size…

Powered by WordPress with [GimpStyle]
Entries and comments feeds.