Tools
How to Configure the Serv-U LDAP Search Filter for Active Directory
This article explains how the LDAP Search Filter in Serv-U works with Active Directory and the difference between using the `userPrincipalName` and `sAMAccountName` attributes for user authentication.
First published date
Last published date
Overview
Serv-U can authenticate users against Active Directory using LDAP. The LDAP Search Filter determines how Serv-U searches for a user account based on the login ID provided by the user.
The default Search Filter uses the `userPrincipalName` attribute:
(&(objectclass=user)(userPrincipalName=$LoginID))
If users log in using their Active Directory username instead of their User Principal Name (UPN), the `sAMAccountName` attribute can be used:
(&(objectclass=user)(sAMAccountName=$LoginID))
This article explains the difference between `userPrincipalName` and `sAMAccountName` and how to select the appropriate Search Filter based on the user's login format.
Product section
Cause
N/A
Resolution
Procedure
- Open the Serv-U Management Console.
- Go to Users > LDAP Authentication.
- Select the LDAP Server, click Edit, and then click Show Advanced LDAP Options.
- Locate the Search Filter field. By default, it is set to:
(&(objectclass=user)(userPrincipalName=$LoginID))
-
The
userPrincipalNameattribute is used when users log in using their User Principal Name (UPN), for example:
user@domain.com
-
If users log in using their Active Directory username (
sAMAccountName), change the Search Filter to:
(&(objectclass=user)(sAMAccountName=$LoginID))
-
Save the changes.
-
Test the configuration by logging in with an Active Directory account.
Example
An Active Directory account may have the following values:
sAMAccountName: jsmith
userPrincipalName: jsmith@domain.com
If the user logs in as:
jsmith
use:
(&(objectclass=user)(sAMAccountName=$LoginID))
If the user logs in as:
jsmith@domain.com
use:
(&(objectclass=user)(userPrincipalName=$LoginID))
Note: $LoginID represents the login ID entered by the user. The attribute used in the Search Filter must match the format of the login ID.