Kdyer
(KiX Supporter)
2002-11-27 07:58 PM
Error 6 when .setinfo is executed

What am I missing?

Does this mean I have to wait for replication to complete? [Smile]

{Edit - Completed code}

code:
 ; ListGroupMembership.kix
BREAK ON
CLS
$cfilename = "H:\groupchange\BC.xls"

$oxl = Createobject("Excel.application")
$rc = $oxl.workbooks.open($cfilename)
$nrow = 1 ; -- Assume Row one is column Headings
WHILE $oxl.cells($nrow, 1).value <> "" ; -- If this is not NULL, keep going
$adsgroup = ""
$userobj = ""
$nrow = $nrow + 1 ; -- Data Starts on row two and add 1 each time
IF $oxl.cells($nrow, 1).value = ""
?"Script is Complete"
SLEEP 4
$oxl.quit
$oxl = ""
RETURN
ENDIF
; -- Get the value of the first field
$value1 = $oxl.cells($nrow, 1).value
?$value1
$domainstring="DOMAIN"
$userstring = $value1

$userobj = GetObject("WinNT://" + $domainstring + "/" + $userstring)

$group = "MMC OR BC"
;$grouppath = $domainstring + "/" + $group
$grouppath = $domainstring + "/" + $group
$adsgroup = GetObject("WinNT://" + $grouppath)
$adsgroup.add("WinNT://" + $domainstring + "/" + $userstring)
$adsgroup.setinfo
;SLEEP 1
IF @Serror <> 0
?@Serror
ENDIF
LOOP
?"Script is complete"
get $

Thanks,

Kent

[ 27. November 2002, 22:22: Message edited by: kdyer ]


LonkeroAdministrator
(KiX Master Guru)
2002-11-27 08:01 PM
Re: Error 6 when .setinfo is executed

well, the error is most common (along 9) with com...
what the add gives?


Kdyer
(KiX Supporter)
2002-11-27 09:00 PM
Re: Error 6 when .setinfo is executed

I think I may need to flush -

$userobj = Nothing
$adsgroup = Nothing

each time it loops through.

Kent


LonkeroAdministrator
(KiX Master Guru)
2002-11-27 09:01 PM
Re: Error 6 when .setinfo is executed

maybe you should even blush?

Kdyer
(KiX Supporter)
2002-11-27 09:24 PM
Re: Error 6 when .setinfo is executed

I think I sorted it out..

We have a child domain where the group resides and the users are in the parent.

Getting a -2147352567 error now..

May need to create the security group in the same domain as the users.

Kent


Howard Bullock
(KiX Supporter)
2002-11-27 09:27 PM
Re: Error 6 when .setinfo is executed

If you are adding master domain accounts to a local group in a resource domain, why does the user and group both use $domainstring? One would think that the two domain strings would be different.

[ 27. November 2002, 21:28: Message edited by: Howard Bullock ]


Chris S.
(MM club member)
2002-11-27 09:43 PM
Re: Error 6 when .setinfo is executed

@SERROR works too.

Kdyer
(KiX Supporter)
2002-11-27 09:43 PM
Re: Error 6 when .setinfo is executed

Changed that..

Still testing. [Big Grin]

Kent


Kdyer
(KiX Supporter)
2002-11-27 10:20 PM
Re: Error 6 when .setinfo is executed

Howard was right..

Yes, had to change the domain to the relevant domain.. We have users in the child and the parent domains..

Well it is now complete..

I will update the initial post for future use.

Kent