LDAP Search – Static DecodeTypes

NetTools defines a number attributes with of static DecodeTypes, this is the list of attributes that have been defined.  The internal constant is used in the list, this maps as DYN_DECODE_GUID to GUID in the attribute Decode list.   See DecodeTypes for more information

Atrtibute Assign DecodeType
accountExpires DYN_DECODE_64TIME
aelita-Amm-SourceGUID DYN_DECODE_GUID
aelita-Amm-SourceSID DYN_DECODE_SID
aelita-Amm-TargetGUID DYN_DECODE_GUID
aelita-Amm-TargetSID DYN_DECODE_SID
attributeCertificateAttribute DYN_DECODE_CERT
attributeSecurityGUID DYN_DECODE_GUID
attributeSyntax DYN_DECODE_ATTRIBENUM
auditPolicy DYN_DECODE_BINARY
badpasswordtime DYN_DECODE_64TIME
cacertificate DYN_DECODE_CERT
certificateRevocationList DYN_DECODE_CRL
createtimestamp DYN_DECODE_GTFTIME
creationtime DYN_DECODE_64TIME
crossCertificatePaie DYN_DECODE_CERT
currenttime DYN_DECODE_GTFTIME
deltaRevocationList DYN_DECODE_CRL
dnsproperty DYN_DECODE_BINARY
dnsrecord DYN_DECODE_DNSRECORD
domainControllerFunctionality DYN_DECODE_ATTRIBENUM
domainFunctionality DYN_DECODE_ATTRIBENUM
dsasignature DYN_DECODE_BINARY
dSASignature DYN_DECODE_DSA_SIG
dSCorePropagationData DYN_DECODE_GTFTIME
ForceLogoff DYN_DECODE_ATTRIBENUM
forestFunctionality DYN_DECODE_ATTRIBENUM
gpoptions DYN_DECODE_ATTRIBENUM
grouptype DYN_DECODE_ATTRIBENUM
IndSS-ActualDate DYN_DECODE_64DATE_UTC
IndSS-PlannedDate DYN_DECODE_64DATE_UTC
IndSS-TaskLastRun DYN_DECODE_64TIME_UTC
instancetype DYN_DECODE_ATTRIBENUM
Invocationid DYN_DECODE_GUID
lastLogon DYN_DECODE_64TIME
lastLogonTimestamp DYN_DECODE_64TIME
lockoutDuration DYN_DECODE_PWDSEC
lockOutObservationWindow DYN_DECODE_PWDSEC
lockoutTime DYN_DECODE_64TIME
lockoutTime DYN_DECODE_64TIME
maxPwdAge DYN_DECODE_PWDSEC
minPwdAge DYN_DECODE_PWDSEC
minPwdAge DYN_DECODE_PWDSEC
modifytimestamp DYN_DECODE_GTFTIME
msDFS-TargetListv2 DYN_DECODE_UNICODE
msds-behavior-version DYN_DECODE_ATTRIBENUM
mS-DS-ConsistencyGuid DYN_DECODE_GUID
msDS-LockoutDuration DYN_DECODE_PWDSEC
msDS-LockoutObservationWindow DYN_DECODE_PWDSEC
msds-ManagedPassword DYN_DECODE_GMSAPWD
msDS-ManagedPasswordId DYN_DECODE_GMSAPWDID
msDS-ManagedPasswordPreviousId DYN_DECODE_GMSAPWDID
msDS-MinimumPasswordAge DYN_DECODE_PWDSEC
msDS-PrefixTable DYN_DECODE_PREFIX_TABLE
msDS-ReplAttributeMetaData DYN_DECODE_META
msDS-ReplAttributeMetaData DYN_DECODE_META
msDS-ReplValueMetaData DYN_DECODE_METAV
msDS-RequiredForestBehaviorVersion DYN_DECODE_ATTRIBENUM
msDS-RequiredDomainBehaviorVersion DYN_DECODE_ATTRIBENUM
msds-SupportedEncryptionTypes DYN_DECODE_ATTRIBENUM
msDS-TrustForestTrustInfo DYN_DECODE_MSTRUST
msds-user-account-control-computed DYN_DECODE_ATTRIBENUM
msDS-UserPasswordExpiryTimeComputed DYN_DECODE_64DATE_UTC
msExchArchiveGUID DYN_DECODE_GUID
msExchMailboxGuid DYN_DECODE_GUID
msExchMailboxSecurityDescriptor DYN_DECODE_SD
msExchMasterAccountSid DYN_DECODE_SID
msExchOMAAdminWirelessEnable DYN_DECODE_ATTRIBENUM
msExchModerationFlags DYN_DECODE_ATTRIBENUM
msExchRecipientDisplayType DYN_DECODE_ATTRIBENUM
msExchRecipientTypeDetails DYN_DECODE_ATTRIBENUM
msExchRemoteRecipientType DYN_DECODE_ATTRIBENUM
msExchSafeSendersHash DYN_DECODE_BINARY
msexchuseraccountcontrol DYN_DECODE_ATTRIBENUM
msFVE-KeyPackage DYN_DECODE_BINARY
msFVE-VolumeGuid DYN_DECODE_GUID
msFVE-RecoveryGuid DYN_DECODE_GUID
msKds-CreateTime DYN_DECODE_64TIME
msKds-KDFParam DYN_DECODE_BINARY
msKds-RootKeyData DYN_DECODE_BINARY
msKds-SecretAgreementParam DYN_DECODE_BINARY
msKds-UseStartTime DYN_DECODE_64TIME
ms-Mcs-AdmPwdExpirationTime DYN_DECODE_64DATE_UTC
msMQDigests DYN_DECODE_BINARY
mSMQSignCertificates DYN_DECODE_BINARY
mspki-certificate-name-flag DYN_DECODE_ATTRIBENUM
mspki-enrollment-flag DYN_DECODE_ATTRIBENUM
mspki-private-key-flag DYN_DECODE_ATTRIBENUM
msrtcsip-archivedefaultflags DYN_DECODE_ATTRIBENUM
msrtcsip-archivingenabled DYN_DECODE_ATTRIBENUM
msrtcsip-archivingserverversion DYN_DECODE_ATTRIBENUM
msrtcsip-enablefederation DYN_DECODE_ATTRIBENUM
msrtcsip-meetingflags DYN_DECODE_ATTRIBENUM
msrtcsip-optionflags DYN_DECODE_ATTRIBENUM
msRTCSIP-OriginatorSid DYN_DECODE_SID
msrtcsip-poolfunctionality DYN_DECODE_ATTRIBENUM
msrtcsip-pooltype DYN_DECODE_ATTRIBENUM
msrtcsip-poolversion DYN_DECODE_ATTRIBENUM
msrtcsip-serverversion DYN_DECODE_ATTRIBENUM
msrtcsip-sourceobjecttype DYN_DECODE_ATTRIBENUM
msrtcsip-trustedserverversion DYN_DECODE_ATTRIBENUM
msrtcsip-ucflags DYN_DECODE_ATTRIBENUM
msRTCSIP-UserRoutingGroupId DYN_DECODE_GUID
mSSMSRangedIPHigh DYN_DECODE_IP_W
mSSMSRangedIPLow DYN_DECODE_IP_W
ntmixeddomain DYN_DECODE_ATTRIBENUM
ntsecuritydescriptor DYN_DECODE_SD
objectclasscategory DYN_DECODE_ATTRIBENUM
ObjectGUID DYN_DECODE_GUID
ObjectSID DYN_DECODE_SID
omobjectclass DYN_DECODE_BEROID
oMSyntax DYN_DECODE_ATTRIBENUM
pkidefaultkeyspec DYN_DECODE_ATTRIBENUM
pkiexpirationperiod DYN_DECODE_PERIOD
pkikeyusage DYN_DECODE_ATTRIBENUM
pkioverlapperiod DYN_DECODE_PERIOD
pktGUID DYN_DECODE_GUID
pwdLastSet DYN_DECODE_64TIME
pwdproperties DYN_DECODE_ATTRIBENUM_NONUM
replPropertyMetaData DYN_DECODE_METAP
repluptodatevector DYN_DECODE_BINARY
replUpToDateVector DYN_DECODE_REPL_UTDV
repsfrom DYN_DECODE_BINARY
repsfrom DYN_DECODE_REPSINFO
repsto DYN_DECODE_BINARY
repsto DYN_DECODE_REPSINFO
ridallocationpool DYN_DECODE_RIDPOOL
ridavailablepool DYN_DECODE_RIDPOOL
ridpreviousallocationpool DYN_DECODE_RIDPOOL
samaccounttype DYN_DECODE_ATTRIBENUM
schemaFlagsEx DYN_DECODE_ATTRIBENUM
schemaIDGUID DYN_DECODE_GUID
sdrightseffective DYN_DECODE_ATTRIBENUM
searchflags DYN_DECODE_ATTRIBENUM
securityIdentifier DYN_DECODE_SID
ServerState DYN_DECODE_ATTRIBENUM
sidhistory DYN_DECODE_SID
supportedcapabilities DYN_DECODE_ATTRIBENUM
supportedcontrol DYN_DECODE_ATTRIBENUM
supportedextension DYN_DECODE_ATTRIBENUM
systemflags DYN_DECODE_ATTRIBENUM
tokengroups DYN_DECODE_SID
tokenGroupsGlobalAndUniversal DYN_DECODE_SID
tokenGroupsNoGCAcceptable DYN_DECODE_SID
trustattributes DYN_DECODE_ATTRIBENUM
trustdirection DYN_DECODE_ATTRIBENUM
trusttype DYN_DECODE_ATTRIBENUM
useraccountcontrol DYN_DECODE_ATTRIBENUM
userCertificate DYN_DECODE_CERT
userparameters DYN_DECODE_BINARY
userSMIMECertificate DYN_DECODE_CERT
validaccesses DYN_DECODE_ATTRIBENUM
WhenChanged DYN_DECODE_GTFTIME
Whencreated DYN_DECODE_GTFTIME

Dynamic & Sort Attributes Options

The Dynamic and Sort Attributes options controls how attributes are decoded and sorted in the LDAP Search table view. 

When the Dynamic Attributes option is selected, before the user query is run, NetTools will query the Schema for all attributes that have the following attributes:

  • Any attributes that have Attribute Syntax of 2.5.5.12 (Sec-Desc) and will set the decode type to DYN_DECODE_SD for these attributes
  • Any attributes that have an Attribute Syntax of 2.5.5.17 (SID) and will set the decode type to DYN_DECODE_SID for these attributes 
  • Any attributes that have an Attribute Syntax of 2.5.5.11 (Generalized Date) and will set the decode type to DYN_DECODE_GTFTIME for these attributes
  • Any attributes that have an Attribute Syntax of 2.5.5.10 (Octet) and a fixed length of 16 and the name contains GUID and will set the decode type to DYN_DECODE_GUID for these attributes

If the Sort Attributes option is also enabled the following additional decode type will be set, this is to support the correct sorting of attribute data in the table view.

  • Any attributes that have Attribute Syntax of 2.5.5.16 (Large-integer) will be set to a decode type of DYN_DECODE_LARGEINT
  • Any attributes that have Attribute Syntax of 2.5.5.9 (Integer) will be set to a decode type of DYN_DECODE_INT

Attributes are have their DecodeType set by this process are shown in the Define Decode dialog with a type as Dynamic.

With both options selected is does result in more data being downloaded from the server, if the server is at the end of a slow link, deselecting these options will increase the speed, but at the cost of functionality.

LDAP Search – Populate

The LDAP Search Populate button is used to load a number of configuration options from the server, these details are then used to enable a number of other features in LDAP Search, this article provides the details of the features that are enabled.  The Populate button is shown below.

Server Bar

When the button is pressed the RootDSE for the server is retrieved and the following details are populated.

  • Sets the ##default, ##config, and ##schema variables with the corresponding naming contexts. See LDAP Search Favorites
  • Set the server field to the server that provided the RootDSE
  • Sets the BaseDN field to the default naming context in the RootDSE, if the server is not AD, this will be set to the first non Configration based NC
  • Instantiates the LDAP API so filter validation is enabled
  • If the Auto Complete option is enabled, the complete list of attributes is also downloaded from the server and the Attribute List button is enabled
  • The complete list of Attributes and classes are available in the LDAP Filter Wizard

NetTools v1.25.11

ACL Browser
Update ACL\ACE Flags option view to display the raw mask data and mask after processing, which will show if there are any unprocessed masks
Trustee Mode updated so only the ACE that apply to the trustee are displayed.
Trustee Information dialog updated to displays the SIDs and associated name for the trustee.  Now also includes the ability to add or remove SIDs to a trustee's SID list, to provide the ability to evaluate the impact of changing a trustee's permissions

SDProp
Updated SDProp to display the results in a list view
Added an option to trigger SDProp Process
Added context menu to reset ACL and AdminCount on selected users See SDProp for updated details

LDAP Search 
Update LDAP Filter Wizard to move change function on a separate button rather than linked to the type selection.
Added new Substitution option {-1:} which will be replaced with 9223372036854775807, which is 0xFFFFFFFFFFFFFFFF and is used on a number of attributes to indicate that the function\operation of the attribute is not set, as in the case for AccountExpires. e.g. (&(accountexpires=*)(!accountexpires=0)(!accountexpires={-1:}))  See LDAP Search Substitutions

Copy to new Window
The functionality of the Copy to new Window has been updated to include the ability filter the displayed results based on text and content filters.  See Copy to new Window for details

LDAP Favorites

This post provides a number of LDAP Search Favorites for common operations, copy the text of the query and import into the favorites, the samples will be saved in the favorites list as the name in square brackets, see Favorites for more information.

Inactive Users
Return a list of users that have not logged on in the last 60 days and excluded any accounts created in the last 60 days

[Users - Inactive Accounts]
Options=660045
Server=
BaseDN=##default
Filter=(&(objectclass=user)(objectcategory=user)(!useraccountcontrol|=2)(|(lastlogontimestamp<={idate:now-60})(&(whencreated<={zdate:now-60})(pwdlastset=0))))
Attributes=canonicalname, samaccountname, displayname, description, pwdlastset, accountexpires, lastlogontimestamp, msExchShadowDepartment, msExchWhenMailboxCreated, msExchRecipientDisplayType, msExchRecipientTypeDetails, homeMDB
DisplayFilter=
Filename=
Sort=
Authentication=1158
Separator=,

Active Accounts
A simple active users query to display a list of users where the user has logged on or changed their password in the last 60 days, and any account that have been created in the last 60 days but the user has not set their password yet.

[Users - Active Accounts]
Options=660036
Server=
BaseDN=##default
Filter=(&(objectclass=user)(objectcategory=user)(!useraccountcontrol|=2)(|(lastlogontimestamp>={idate:now-60})(pwdlastset>={idate:now-60})(&(whencreated>={zdate:now-60})(pwdlastset=0))))
Attributes=canonicalname, samaccountname, displayname, description, pwdlastset, accountexpires, lastlogontimestamp, msExchShadowDepartment, msExchWhenMailboxCreated, msExchRecipientDisplayType, msExchRecipientTypeDetails, homeMDB
DisplayFilter=
Filename=
Sort=
Authentication=1158
Separator=,

Active User with user input
This query is the same as the one above however the static 60 days used above is replaced with a prompt.  At execution time a dialog will be displayed to enter the Activity Period.  In the query the static 60 has been replaced with {userinput:Activity Period (Days)} to prompt for the value.  This Subst is used a number of times in the query but only prompted for once, as the first response is cached and used for subsequent entries with the same label.  See Substitutions

[Users - Active Accounts Input]
Options=8590594637
Server=
BaseDN=##default
Filter=(&(objectclass=user)(objectcategory=user)(!useraccountcontrol|=2)(|(lastlogontimestamp>={idate:now-{userinput:Activity Period (Days)})(pwdlastset>={idate:now-{userinput:Activity Period (Days)}})(&(whencreated>={zdate:now-{userinput:Activity Period (Days)}})(pwdlastset=0)))(|(accountExpires=0)(accountExpires=9223372036854775807)(accountExpires<={idate:now})))
Attributes=canonicalname, samaccountname, displayname, description, pwdlastset, accountexpires, lastlogontimestamp, msExchShadowDepartment, msExchWhenMailboxCreated, msExchRecipientDisplayType, msExchRecipientTypeDetails,accountExpires
DisplayFilter=
Filename=
Sort=
Authentication=1158
Separator=,

Active Accounts Count
This is the same as the first active accounts queries, but this doesn't display any details of the users, just the count.

[Users - Active Accounts Count]
Options=8590594628
Server=
BaseDN=##default
Filter=(&(objectclass=user)(objectcategory=user)(!useraccountcontrol|=2)(|(lastlogontimestamp>={idate:now-60})(pwdlastset>={idate:now-60})(&(whencreated>={zdate:now-60})(pwdlastset=0))))
Attributes=1.1
DisplayFilter=
Filename=
Sort=
Authentication=1158
Separator=,

Active Accounts (More Complex)
This query builds on the queries above and include the account expires attributes in the checking.

[Users - Active Accounts AE]
Options=8590594637
Server=
BaseDN=##default
Filter=(&(objectclass=user)(objectcategory=user)(!useraccountcontrol|=2)(|(lastlogontimestamp>={idate:now-60})(pwdlastset>={idate:now-60})(&(whencreated>={zdate:now-60})(pwdlastset=0)))(|(accountExpires=0)(accountExpires=9223372036854775807)(accountExpires<={idate:now})))
Attributes=canonicalname, samaccountname, displayname, description, pwdlastset, accountexpires, lastlogontimestamp, msExchShadowDepartment, msExchWhenMailboxCreated, msExchRecipientDisplayType, msExchRecipientTypeDetails, homeMDB
DisplayFilter=
Filename=
Sort=
Authentication=1158
Separator=,

Disable users
This favorite is a input mode Update query which will disable the provided list of SamAccountNames, it will prompt for a change number which will be added to the Info field of each user.  See Update Queries for more information about update queries.

Warning: This is a Update Query which will make changes to your AD once the update feature is enabled

[Users - Disable Users]
Options=489626931805
Server=
BaseDN=##default
Filter=(samaccountname=##input)
Attributes=useraccountcontrol=|2:2, info==Account disabled as part of change {userinput:Enter Change Number}\n{attrib:info}
DisplayFilter=
Filename=
Sort=
Authentication=1158
Separator=,

AD Tombstone Period
This query will display the current AD tombstone period for deleted\recycled objects.

[AD Tombstone Period]
Options=132677
Server=
BaseDN=CN=Directory Service,CN=Windows NT,CN=Services,##config
Filter=(objectclass=*)
Attributes=tombstonelifetime
DisplayFilter=
Filename=
Sort=
Authentication=1158
Separator=,

AD Schema Version
This query will display the current AD schema version

[Schema Version - AD]
Options=132673
Server=
BaseDN=##schema
Filter=(objectclass=*)
Attributes=objectversion
DisplayFilter=
Filename=
Sort=
Authentication=1158
Separator=,

 Exchange Schema Version
This query will display the current exchange schema version.

[Schema Version - Exchange]
Options=132673
Server=
BaseDN=CN=ms-Exch-Schema-Version-Pt,##schema
Filter=(objectclass=*)
Attributes=rangeupper
Filename=
Authentication=1158
User=
Domain=

OCS Schema Version
This query will display the current OCS\Link\SfB schema version.

[Schema Version - OCS]
Options=132673
Server=
BaseDN=CN=ms-RTC-SIP-SchemaVersion,##schema
Filter=(objectclass=*)
Attributes=rangeupper,rangelower
Filename=
Authentication=1158
User=
Domain=

Root DSE
This query will return the default values for the RootDSE

[RootDSE]
Options=656901
Server=
BaseDN=NULL
Filter=(objectclass=*)
Attributes=
DisplayFilter=
Filename=
Sort=
Authentication=0
Separator=,

RootDSE (Full)
This query will display both the default and optional values of the RootDSE, the values returned are based on the current DC OS and DFF level.

[RootDSE (Full)]
Options=132613
Server=
BaseDN=NULL
Filter=(objectclass=*)
Attributes=*,domainControllerFunctionality,domainFunctionality,forestFunctionality,msDS-ReplAllInboundNeighbors,msDS-ReplAllOutboundNeighbors,msDS-ReplConnectionFailures,msDS-ReplLinkFailures,msDS-ReplPendingOps,msDS-ReplQueueStatistics,msDS-TopQuotaUsage,supportedConfigurableSettings,supportedExtension,dsaVersionString,msDS-PortLDAP,msDS-PortSSL,msDS-PrincipalName,serviceAccountInfo,spnRegistrationResult,validfsmos,tokenGroups,usnAtRifm
Filename=
Authentication=1158
Separator=,

 

 

NetTools v1.24.4

ACL Browser
Fixed issue were attribute GUID are not loaded into the cache intermittently
LDAP Search
Added option to displayed extended error reporting
Updated string substitutions to include {sdate:now} and {sdatetime:now} to display the current date or date and time. Date format is fixed as DD/MM/YYYY.
Updated the copy favorites to clipboard option to copy the settings currently being displayed
Updated favorites to support ##inputn in the BaseDN field
UNC Check
Updated UNC dropdown to display the MRU UNC path from the Run dialog

LDAP Search – Conditional Attributes

Conditional Attributes allow the user to define the value that is returned based on a true or false conditional statement that is assessed for each object returned by the query. The condition comprises of two variables and a logic operator, and two results. The variables and results can be based on attributes of the object or static entries.

A Conditional Attribute has the following Syntax:

<Attribute>;{if:<Variable1>[;DataType] <Op> <Variable2>:<True Result>:<False Result>}{;DecodeType}

Attribute - The name against which the value will be returned; it will be displayed as if it were an attribute of the object.
Variable1, Variable2 - These are values that will be compared; these can be attributes of the object or static values. Attributes are referenced by specifying the name of the attribute. The meta type can also be used as the attribute. For Static values, encapsulate the value in quote marks i.e. "True".  A wildcard character * can be used in a static value for Variable2, to find the value anywhere in the value returned by the attribute i.e. "*disable"

Op - Defines the logical operator used to compare the two variables:

== Equal
!= Not Equal
>= Greater or equal
<= Less or equal
> Greater than
< Less than

DataTypes - defines if the variable needs to be converted into a different format before the comparison is completed. If the DataType is only provided for one variable, then both variables are converted to the specified DataType.
The following DataTypes are supported:

Int - Convert the variable to an Integer
Date - Convert the variable to a Date
Len - Returns the length of the variable, if the DataType of the other variable is not specified then Int DataType is assumed

Note: **ERR_DATA_CONV** is returned if the value can't be converted to the selected datatype.

True Result The value that will be returned if the condition is true
False Result The value that will be returned if the condition is false
The result values can also be attributes or static values and use the same formatting as the variables.  The attribute can also use the metadata datatype.

DecodeType - This is used to convert the output using the DecodeTypes.  See Decode Types

Examples:

Updated;{if:usnchanged!=usncreated:"Updated":"Unchanged"}
Active;{if:useraccountcontrol=="*disable":"False":"True"}
LogonTime;{if:lastlogon;date>lastlogontimestamp:lastlogon:lastlogontimestamp}
Changed;{if:meta.time.unicodepwd!=pwdlastset:"invalid":"valid"}
SD Changed;{if:meta.time.nTSecurityDescriptor;date>"{userinput:Change Date}":"True":"False"}

Both the Variables and Results can use any of the filter substitution options, in this case they must be defined as static entries, i.e. encapsulated in quote marks. See Substitutions

LDAP Search Favorites

The LDAP Search option in Nettools allows users to save queries as favorites for reuse.  Additionally, it offers options for exporting and importing queries.  To save a query as a favorite, follow these steps: first, set up the query as required; second, enter the name in the Favorite field; and then click the Save button.

Previously saved favorites can be displayed by clicking on the dropdown list at the end of the favorite field. Favorites are saved in the NetTools.ini file using standard ini formatting.  Here is an example of a saved favorite called 'Active Users':

[Active Users]
Options=879892770722381
Server=localhost
BaseDN=cn=project
Filter=(&(objectclass=user)(!useraccountcontrol|=2))
Attributes=samaccountname
DisplayFilter=
Filename=
Sort=
Authentication=1158
Separator=,

NetTools comes with over 280 predefined queries, the full list of queries is here.  More examples and information on other favorites can be found here

Variables

The saved favorites support the use of variables to allow a saved queries to be used on any directory, not just the directory they were originally created against. The following variables are supported:
##default - This will be replaced with the default name context as defined by the defaultNamingContext in the RootDSE
##config - This will be replaced with the configuration name context as defined by the configurationNamingContext in the RootDSE
##root - This will be replaced with the root name context as defined by the rootDomainNamingContext in the RootDSE. V1.30.8 and above
##schema - This will be replaced with the schema name context as defined by the schemaNamingContext in the RootDSE
NULL - This is used to set the field to blank

By default, if the field value is not defined in the ini, then the field is not changed when the favorite is selected, and the current value is preserved.

The variable can be entered in the corresponding field before the favorite is saved or by editing the NetTools.ini after the favorite has been saved. The variables are populated when the Populate button is pressed (See LDAP Search Populate), and then by selecting the saved favorite the variables will be replaced with the relevant details.

NetTools also supports the option to share your favorite using the import and export functions.  At the end of the favorites field there are three button, to save, export and import a favorite to and from the clipboard.  When the Import button is pressed the following dialog is displayed and the favorite text can be pasted into the dialog and added.  The imported favorite will be saved based on the name in the square bracket, if the favorite already exists it will be overwritten.

 

Context Favorites

LDAP Search also support context-based favorites, these favorites are not listed in the favorite dropdown list, they are displayed under the Custom menu item on the context menu for the text pane.  With Context Favorites, it is possible to pass the selected text in the text output pane to the favorite.

To create a Context Favorite, the name used to save the Favorite must start with ##sel i.e. ##selGet Details.  The favorite will be displayed as Get Details under the Custom option on the context menu

The selected text from the Text view pane can be passed to the query by using the ##sel as a substitution for any field in the favorite.

[##selGet Details (samaccountname)]
Options=879892770719309
Server=
BaseDN=##default
Filter=(samaccountname=##sel)
Attributes=displayname, accountexpires, pwdlastset, lastlogontimestamp, useraccountcontrol
DisplayFilter=
Filename=
Sort=
Authentication=1158
Separator=,

In this example, the selected text is expected to be the samaccountname, and the favorite will search for the details of the object.  To prompt what details should be in the selected text, add this to the Favorite name as in the example.

See Favorites for more examples

LDAP Search Substitution

NetTools supports a number of Inline substitution options, that enables different data types to be entered in a user friendly formats, without the need to remember complicated data formats.  These can be used in the filter to simplify filter entry or convert data format for attribute updates with Update Queries.

There are two types of substitutions available, data converters, and matching rule converters.

Data Converters
Data converters have the following format {<type>:[data]}

-1: int64 const of -1 e.g. (pwdlastset={-1:}) which will be replaced with 9223372036854775807
anr: Create an ANR filter based on the input string e.g. {anr:john smith}
getdn: return the DN for the specified samaccountname e.g. {getdn: domain admins} {getdn:user1}
guid: object guids e.g. (objectguid={guid:00AD5B16-8E22-49D5-B83A-BFDEA6DFF7DE})
hex: hexadecimal value e.g. (&(objectclass=group)(grouptype={hex:0x8000002}))
idate: 64bit Time e.g. (lastlogontimestamp={idate:31/12/2011})
ip: IP address in windows order e.g. (ipaddress={ip:10.12.45.254})
ipn: IP address in network order e.g. (ipaddress={ipn:10.12.45.254})
oid: oid identifiers e.g. (omobjectclass={oid:1.3.12.2.1011.28.0.702})
sdate: returns the date in dd/mm/yyyy format, when used in conjunction with Now constant e.g. {sdate:now}
sdatetime: returns the date in dd/mm/yyyy hh:mm:ss format, when used in conjunction with Now constant
sid: object sid e.g. (objectsid={sid: S-1-5-21-3499964120-3315823391-1593708255-164234})
unicode: return the specified string as escape hex string {unicode:new}
userinput: request user input e.g. {userinput:Date} responses are cached against the label, if the same label is used again the cached response is used
zdate: Generalized Time Format e.g. (whencreated={zdate:30/12/2011})

zdate, idate, sdate, and sdatetime types also support a number of constants 'Now', StartofDay, EndofDay, and can be used with with optional plus and minus days.
e.g. {zdate:now}, {zdate:now-365}, {idate:now+5}, {sdate:now}
{zdate:startofday}, {zdate:endofday}, {idate:startofday-5}

Nesting is supported on a number of the substitutions to convert from one format to another or converting a user input e.g  {idate:{usernput:enter date}}

Matching Rules Converters
Matching rule converters use a single character as a substitute for the matching rule OIDs for LDAP filters, these are |  & % $

|= is the Or bit logic operator e.g. (!useraccountcontrol |= 2)  - expands to (!useraccountcontrol:1.2.840.113556.1.4.802:=2)

&= is the And bit logic operator e.g. (useraccountcontrol &= 2)  - expands to (useraccountcontrol:1.2.840.113556.1.4.803:=2)

%= is the chain operator e.g. (memberof %= (cn=Group1,OU=groupsOU,DC=test,DC=com)) - expands to (memberof:1.2.840.113556.1.4.1941:= (cn=Group1,OU=groupsOU,DC=test,DC=com))

$= is the DN-Binary or DN-String search e.g. (msDS-HasInstantiatedNCs$=B:8:0000000D:CN=Configuration,DC=corp) - expands to (msDS-HasInstantiatedNCs:1.2.840.113556.1.4.2253:=B:8:0000000D:CN=Configuration,DC=corp)