From: <Sim...@wi...> - 2000-11-20 14:10:20
|
Hi, I am struggling with composing a filter and I hope someone on the list can point me in the right direction. I am using Net::LDAP v0.19, perl 5.005_03 against Novell eDirectory The script I am working on is to display a list of users who have never logged on to the network. This is stored in the LDAP attribute lastLoginTime in eDirectory. If I make the filter (& (objectclass=inetOrgPerson) (lastLoginTime=*)) I get a list of the users who have logged in. Can I somehow reverse this so that I get a list of those who do NOT have a lastLoginTime attribute ? I tried the obvious (& (objectclass=inetOrgPerson) (lastLoginTime!=*)) but that just died with a "Bad filter" error. It seems that Novell does not return an attribute at all rather than an attribute that has a null value. My workaround is just to get all the users and then test for the attribute in the return list but it isn't going to scale very well ;-) All help much appreciated. Rgds, Simon Wilcox Intranet Development Manager Williams Lea Group ______________________________________________________________________ This email contains proprietary information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this email, please notify the author by replying to this email. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or reply on this email. |
From: Mark W. <mew...@un...> - 2000-11-20 15:06:29
|
the NOT, must precede the () just like the AND thus try : (&(!(lastlogintime=*))(objectclass=inetorgPerson)) mark Sim...@wi... wrote: > Hi, > > I am struggling with composing a filter and I hope someone on the list can > point me in the right direction. > > > I am using Net::LDAP v0.19, perl 5.005_03 against Novell eDirectory > > The script I am working on is to display a list of users who have never > logged on to the network. > > This is stored in the LDAP attribute lastLoginTime in eDirectory. > > If I make the filter (& (objectclass=inetOrgPerson) (lastLoginTime=*)) I > get a list of the users who have logged in. > > Can I somehow reverse this so that I get a list of those who do NOT have a > lastLoginTime attribute ? > > I tried the obvious (& (objectclass=inetOrgPerson) (lastLoginTime!=*)) but > that just died with a "Bad filter" error. > > It seems that Novell does not return an attribute at all rather than an > attribute that has a null value. > > My workaround is just to get all the users and then test for the attribute > in the return list but it isn't going to scale very well ;-) > > All help much appreciated. > > Rgds, > > Simon Wilcox > Intranet Development Manager > Williams Lea Group > > ______________________________________________________________________ > > This email contains proprietary information some or all of which may be > legally privileged. It is for the intended recipient only. If an addressing > or transmission error has misdirected this email, please notify the author by > replying to this email. If you are not the intended recipient you must not > use, disclose, distribute, copy, print, or reply on this email. |
From:
<jo...@pt...> - 2000-11-20 15:07:21
|
Hi, what you probably want is (& (objectclass=inetOrgPerson) (!(lastLoginTime=*))) Works over here, openldap2. Sim...@wi... wrote: > > Hi, > > I am struggling with composing a filter and I hope someone on the list can > point me in the right direction. > > I am using Net::LDAP v0.19, perl 5.005_03 against Novell eDirectory > > The script I am working on is to display a list of users who have never > logged on to the network. > > This is stored in the LDAP attribute lastLoginTime in eDirectory. > > If I make the filter (& (objectclass=inetOrgPerson) (lastLoginTime=*)) I > get a list of the users who have logged in. > > Can I somehow reverse this so that I get a list of those who do NOT have a > lastLoginTime attribute ? > > I tried the obvious (& (objectclass=inetOrgPerson) (lastLoginTime!=*)) but > that just died with a "Bad filter" error. > > It seems that Novell does not return an attribute at all rather than an > attribute that has a null value. > > My workaround is just to get all the users and then test for the attribute > in the return list but it isn't going to scale very well ;-) > > All help much appreciated. > > Rgds, > > Simon Wilcox > Intranet Development Manager > Williams Lea Group > > ______________________________________________________________________ > > This email contains proprietary information some or all of which may be > legally privileged. It is for the intended recipient only. If an addressing > or transmission error has misdirected this email, please notify the author by > replying to this email. If you are not the intended recipient you must not > use, disclose, distribute, copy, print, or reply on this email. |
From: Chris R. <chr...@me...> - 2000-11-21 17:20:52
|
Sim...@wi... wrote: > It seems that Novell does not return an attribute at all rather > than an attribute that has a null value. I'm not quite sure what this means. It is not legal in LDAP to have an attribute with no values. Some attributes have syntaxes which support values which are zero-length strings, which is *not* the same as 'no value'. (Example: distinguished names can be zero-length, ie the root has a string DN of "".) Cheers, Chris |