Page 2 of 2 <12
Topic Options
#14161 - 2001-11-21 01:39 AM Re: GroupAdd UDF
Mark Pietersz Offline
Getting the hang of it

Registered: 2001-09-30
Posts: 74
Loc: Melbourne, Australia
Shawn

Have tried this but still no good. Is anybody using this feature successfully at the moment ? I get the feeling that I'm doing something fundamentally wrong. Perhaps someone can post code that is executing successfully

_________________________
Mark Pietersz

Top
#14162 - 2001-11-22 01:34 AM Re: GroupAdd UDF
mvdw Offline
Starting to like KiXtart

Registered: 2001-05-01
Posts: 124
Loc: Voorburg, Netherlands
Hi all,

finally got my adsl...

i don't seem to be having any problems executing this code towards either my local machine or towards a plain old nt4 pdc.

code:
 
break on

$usr = GETOBJECT("WinNT://wcws321/administrators,group")
if @error = 0
$rc = $usr.getinfo


$propcount = $usr.propertycount
? "number of properties found: " + $propcount
?
$property = $usr.next()

while @error = 0 AND $property <> ""
? "Property name :" + $property.name
? "property type :" + $property.adstype
for each $propval in $property.values
$value = $propval
if $property.adstype = 3
? "with the value :" + $value.caseignorestring
endif
if $property.adstype = 7
? "with the value :" + $value.integer
endif
if $property.adstype = 8
? "with the value :" + $value.octetstring
endif
?
next
$property = $usr.next
loop

$user = 0
get $k

exit


succesfully binding to the group and displaying it's properties.

The following is a snippet of a user creation script using adsi/kix4 again against nt4 domains, this time using opendsobject method and all vars.

code:
 
for each $item in $fixedgroups
$grp = $root.opendsobject("WinNT://$domain/$item,group","$connuser","$connpw",1)
if @error = 0 and $grp <> ""
$grp.add("WinNT://$domain/$username")
$grp = 0
else
? "group $item not found, error:"
? @serror
$grp = 0
endif
next

btw i should finish up the loop in that script, it is quite nice..(remember getRID udf Shawn ???)

rgrds,
Maarten

_________________________
rgrds, Maarten

Top
#14163 - 2001-11-22 05:24 AM Re: GroupAdd UDF
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Maarten

Good to see you back on the board ... so you've got high speed internet access now ? sweet eh ?

Was hoping maybe we could resurect some of that user create stuff we were working on ... especially now that the UDF forum is online [well, sort of online anyway ] ...

-Shawn

[ 22 November 2001: Message edited by: Shawn ]

Top
#14164 - 2001-11-22 11:11 AM Re: GroupAdd UDF
mvdw Offline
Starting to like KiXtart

Registered: 2001-05-01
Posts: 124
Loc: Voorburg, Netherlands
Oh yeah, boy it's nice to have some decent access again...

I need some time this weekend to build up a small server type machine at home first, but i was also thinking to finalize that script, and then break it down to ADSI related udf's. i've already coded quite a few in the mean time. Most of them are still too messy though, they will need rigorous clean up and catching of customer specific data into vars.

i see i've got a lot of catching up to do here...

_________________________
rgrds, Maarten

Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.082 seconds in which 0.039 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org