Page 1 of 2 12>
Topic Options
#14141 - 2001-11-12 10:59 AM GroupAdd UDF
Mark Pietersz Offline
Getting the hang of it

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

Having problems with using the GroupAdd UDF
On trying to add a user to to domain group the function fails at:
$group = GetObject("WinNT://$target/$group")

I have even tried to hard code but i keep getting the error -2147024843.

Platform
NT Server 4.0, SP6a
KiXtart 2001, RC3, Build 50
ADSI 2.5

I look forward to your responses

_________________________
Mark Pietersz

Top
#14142 - 2001-11-12 11:07 AM Re: GroupAdd UDF
Mark Pietersz Offline
Getting the hang of it

Registered: 2001-09-30
Posts: 74
Loc: Melbourne, Australia
A bit more info

GetObject("WinNT://[domain name]") returns error code 0. It seems to complain when I extend it to GetObject("WinNT://[domain name]/[group name]")

The user that the script runs under has full domain access rights as far as I am aware

_________________________
Mark Pietersz

Top
#14143 - 2001-11-12 03:08 PM Re: GroupAdd UDF
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
what is the Group name?

It is a NT domain?

Bryce

Top
#14144 - 2001-11-12 03:14 PM Re: GroupAdd UDF
Mark Pietersz Offline
Getting the hang of it

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

The group name is PS_Developers and the domain is an NT domain. Would you prefer to continue this via email ?

_________________________
Mark Pietersz

Top
#14145 - 2001-11-12 03:26 PM Re: GroupAdd UDF
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
I am just now on my way to work, I will take a closer look when i get into the office.

You going to be around for a while? I know it has to be getting towards evening where you are.

Bryce

Top
#14146 - 2001-11-12 03:30 PM Re: GroupAdd UDF
Mark Pietersz Offline
Getting the hang of it

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

You are correct. In fact it's about half past twelve at night. I have had a backup tape device failure and am in the process of implmenting a workaround. It's going well so I suspect that I will be gone in about 45 minutes. Is there any further info that I can supply ?

_________________________
Mark Pietersz

Top
#14147 - 2001-11-12 03:33 PM Re: GroupAdd UDF
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
that is it for now.
Top
#14148 - 2001-11-12 05:17 PM Re: GroupAdd UDF
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Are you sure this is a global group?... nope, just tested that and a local group works just fine.

You do have ADSI installed on all Domain controllers?

what does the @serror macro say?

Bryce

Top
#14149 - 2001-11-13 03:33 AM Re: GroupAdd UDF
Mark Pietersz Offline
Getting the hang of it

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

The group is global ( i also tried with "Domain Admins") however ADSI is NOT installed on all domain controllers. I'm sure that it is not included as part of our standard NT server setup.

What is the requirement for the installation of ADSI for GetObject("WinNT:// etc) to work ?

Is it possible to test scripts without all controllers having ADSI installed ?

_________________________
Mark Pietersz

Top
#14150 - 2001-11-13 03:35 AM Re: GroupAdd UDF
Mark Pietersz Offline
Getting the hang of it

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

@SERROR returns

Error (317 / 13D) while retrieving error information for 8007203A

_________________________
Mark Pietersz

Top
#14151 - 2001-11-13 04:32 AM Re: GroupAdd UDF
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Bryce and Mark,

I don't think the PDC/BDC require ADSI (I could be wrong) I have tried your previous group add code on a Windows 2000 workstation and I dd not have any problem with it. I think only the calling system needs the ADSI?

Mark,
Can you please post your code. Maybe I was using a different piece of code from Bryce.

Top
#14152 - 2001-11-13 04:41 AM Re: GroupAdd UDF
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Win2k comes with ADSI installed.

ALL NT4.0 computers involved in a ADSI connection will need ADSI installed

Top
#14153 - 2001-11-13 05:43 AM Re: GroupAdd UDF
Mark Pietersz Offline
Getting the hang of it

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

Unfortunately we are still on a NT Server/Win9x client infrastructure although we are looking to move to Win2K.

Another tricky one is that the provider is case sensitive ie WINNT is not the same as WinNT.

Q. If ALL NT machines involved in the ADSI exchange require ADSI to be installed what machines are being used when you call WinNT://Domain/Group

_________________________
Mark Pietersz

Top
#14154 - 2001-11-13 11:21 AM Re: GroupAdd UDF
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
NTDOC is right, only the calling system needs to have ADSI installed, i use it with great plessure from my Win95 workstation at work, and none of my DC's have ADSI installed (ALL NT4).

I don't suppose that Win9x handles ADSI better than NT

Erik

Top
#14155 - 2001-11-13 01:28 PM Re: GroupAdd UDF
Mark Pietersz Offline
Getting the hang of it

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

My calling machine does have ADSI installed

The code is quiet straight forward

$dom = GetObject("WinNT://ADECCO")
returns no error

$dom = GetObject("WinNT://ADECCO/Domain Users")
returns the error as mentioned

_________________________
Mark Pietersz

Top
#14156 - 2001-11-13 03:59 PM Re: GroupAdd UDF
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
what does @serror say?

every time i have tried to do an ADSI task on a remote NT4 computer it would fail if ADSI was not installed... weird.

Top
#14157 - 2001-11-13 05:47 PM Re: GroupAdd UDF
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Bryce,

What exactly do you mean when you say

"do an ADSI task on a remote NT4 computer"

you mean, for example, if you were to run a script on your w2k wks that enumerated all services on an NT4 domain controller, it would fail. And installing ADSI on your DC fixed the problem ? Like Erik, said (and I know you know this) ... the whole purpose of the WinNT service provider is to provide backward-compatible support for NT ... no ADSI need be installed (on the "target" machine) ... this is very perplexing ?

Same with Mark's problem .. very weird ... so Mark - in your example, ADECCO is your domain name ?

-Shawn

Top
#14158 - 2001-11-13 08:19 PM Re: GroupAdd UDF
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
ok, i just ran this code to get more informtion on the @error being thrown.

code:

seterror("-2147024843")
? @error
? @serror

function seterror($a)
exit($a)
endfunction


and i get the following.

-2147024843
The network path was not found.


As for needing ADSI in the remote computer....Looks like i may be wrong!

Top
#14159 - 2001-11-14 06:57 AM Re: GroupAdd UDF
Mark Pietersz Offline
Getting the hang of it

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

ADECCO is the domain name. Interesting that @serror returned by me

"Error (317 / 13D) while retrieving error information for 8007203A"

is different to the one returned by Bryce
"The network path was not found."

Certainly $dom = GetObject("WinNT://ADECCO")
works and if I loop through the objects returned I get lots of stuff back.

I'm very perplexed. Is the solution to install ADSI on all computers or all network servers or just DCs and BDCs ?

_________________________
Mark Pietersz

Top
#14160 - 2001-11-14 02:02 PM Re: GroupAdd UDF
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Mark, the only other thing you could try is be super specific and say this:

$dom = GetObject("WinNT://ADECCO/Domain Users,group")

add the GROUP qualifier to the end of the string ...

-Shawn

[ 14 November 2001: Message edited by: Shawn ]

Top
Page 1 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.071 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

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