#180646 - 2007-09-17 09:12 PM
Stripping Characters
|
danilda
Fresh Scripter
Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
|
I have returned group members using fnldapquery, but only want the user's name. Does anyone know of a way to strip the extraneous data out?
thanks -- dee
|
|
Top
|
|
|
|
#180723 - 2007-09-19 06:28 PM
Re: Stripping Characters
[Re: danilda]
|
danilda
Fresh Scripter
Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
|
The return code would be CN=James Doe,OU=Users,DC=something,DC=com. I only want the CN name, nothing else.
|
|
Top
|
|
|
|
#180728 - 2007-09-19 07:04 PM
Re: Stripping Characters
[Re: Allen]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Indeed, a number of waysBreak On
;Declare variables
Dim $Name, $CN
;Initialize variables
$Name = "CN=James Doe,OU=Users,DC=something,DC=com"
;Code
$CN = Split(Split($Name,",")[AScan(Split($Name,","),"CN=",,,1)],"=")[1]
$CN ?
|
|
Top
|
|
|
|
#180736 - 2007-09-19 07:55 PM
Re: Stripping Characters
[Re: Les]
|
danilda
Fresh Scripter
Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
|
Thanks for all the responses. Using fnldap query attributes to get members of a group. Now can someone tell me how to replacedouble spaces in the middle of the string with one space?
|
|
Top
|
|
|
|
#180760 - 2007-09-20 03:59 PM
Re: Stripping Characters
[Re: Glenn Barnas]
|
danilda
Fresh Scripter
Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
|
Thanks for everyone's help.
Dee
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(StuTheCoder)
and 798 anonymous users online.
|
|
|