#89823 - 2002-11-27 07:58 PM
Error 6 when .setinfo is executed
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
What am I missing?
Does this mean I have to wait for replication to complete?
{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 ]
|
Top
|
|
|
|
#89825 - 2002-11-27 09:00 PM
Re: Error 6 when .setinfo is executed
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I think I may need to flush -
$userobj = Nothing $adsgroup = Nothing
each time it loops through.
Kent
|
Top
|
|
|
|
#89827 - 2002-11-27 09:24 PM
Re: Error 6 when .setinfo is executed
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
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
|
Top
|
|
|
|
#89828 - 2002-11-27 09:27 PM
Re: Error 6 when .setinfo is executed
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
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 ]
|
Top
|
|
|
|
#89830 - 2002-11-27 09:43 PM
Re: Error 6 when .setinfo is executed
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Changed that..
Still testing.
Kent
|
Top
|
|
|
|
#89831 - 2002-11-27 10:20 PM
Re: Error 6 when .setinfo is executed
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
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
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 515 anonymous users online.
|
|
|