[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Querying an Active Directory memberOf Attribute

Subject: RE: Querying an Active Directory memberOf Attribute
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 1 Aug 2006 09:36:05 +0100
active directory memberof
I think you've made the mistake of imagining that contains(A,B) tests
whether the set A includes an item equal to B. If you read the spec, you'll
see that it actually tests whether the string A contains B as a substring.
To test the first condition, use A=B.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Cailo . [mailto:frenzal68@xxxxxxxxxxx] 
> Sent: 01 August 2006 07:48
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Querying an Active Directory memberOf Attribute
> 
> Hi all,
> 
> I am new to this and I am pulling my hair out. I am working 
> on a product called RightFax which has the ability to sync 
> users in from Active Directory using XSL. I am trying to 
> query the Active Directory memberOf attribute and depending 
> on whether the user is in a particular group, put them in the 
> respective group within RightFax. My problem is that because 
> memberOf is an array within AD, the query is only searching 
> the first 'string' of the array and hence not returning 
> correct results. What I would like to do is to either query 
> the entire array or join each string within the array to 
> create one long string, then query the string. Please see 
> below my script:
> 
> <xsl:template match="rf:attr[@name='memberOf']">
>   <attr name="GroupID">
>     <value>
>       <xsl:variable name="group" select="*" />
>       <xsl:choose>
>         <xsl:when 
> test="contains($group,'Group_1')">100663298</xsl:when>
>         <xsl:when 
> test="contains($group,'Group_2')">100663299</xsl:when>
>         <xsl:otherwise><xsl:value-of select="100663296" 
> /></xsl:otherwise>
>       </xsl:choose>
>     </value>
>   </attr>
> </xsl:template>
> 
> 
> I have done this previously with javascript and it worked 
> fine however I am unable to get this to work. Please see 
> below the javascript:
> 
> Dim strGroups
> If IsArray(varProp) Then
>     strGroups = (Join(varProp))
>        If (InStr(strGroups, "CN=Group_1") > 0 ) Then
>              objUser.IsUnprotected = 0
>              objUser.GroupID="Orlando"
>        End If
> End If
> 
> 
> Any help would be greatly appreciated.
> 
> Thanks in advance
> 
> Cails

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.