Avatar of lgduong
Flag for United States of America asked on

VBscript LDAP parameter to PHP

I am trying to recreate a script written in vbscript that have this filter for LDAP.  I would like to get in to a PHP version of LDAP filter.

sFilter = "(&(&(|(&(objectCategory=person)(objectSid=*)(!samAccountType:" _
& "(&(objectCategory=person)(!objectSid=*))(&(objectCategory=group)(groupType:" _
& "(objectCategory=user)(sAMAccountName=" & xUsrNm & ")))"

I am not used to querying for some many parameters.
VB ScriptPHPActive Directory

Avatar of undefined
Last Comment

8/22/2022 - Mon

Hi, I'm not really a PHP guy, but I'm pretty sure it would be this
$xUsrNm = "myuser";

$sFilter = "(&(&(|(&(objectCategory=person)(objectSid=*)(!samAccountType:" .
"(&(objectCategory=person)(!objectSid=*))(&(objectCategory=group)(groupType:" .

Open in new window



I've tried that. Still didn't worked. However a much simpler solution for what I needed from ldap was proposed and it worked.  So this is no longer a problem.  Thank you for your help anyway.

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

A simpler solution to get what I needed was shared with me by colleague so I did not need further assistance from Experts.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck