Page 1 of 1 1
Topic Options
#151731 - 2005-11-17 07:06 PM Errors using GroupAdd UDF
jdogg Offline
Getting the hang of it

Registered: 2003-09-11
Posts: 91
Loc: RTP, North Cakalaka, USA
Hey guys.
I am encountering errors using a script to add the Domain Users global group to the Power Users local group on a list of machines in a specific OU.
I am using the fnLDAPQuery and GroupAdd UDFs.
Here is my code (minus the UDFs)
Code:
Break On
;RedirectOutput("c:\jobs\lclGroupModder.log")
$aAttributes = "name"
$sADsPath = "LDAP://OU=Computers,OU=MOR,OU=US,DC=na,DC=healthcare,DC=cnb"
$strFilter = "(objectClass=Computer)"
$aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter)
FOR each $res in $aResults
"GroupAdd('$res', '$res\Power Users', 'Domain Users')"?
$junk=GroupAdd('$res', '$res\Power Users', 'Domain Users')
@SERROR ?
Next



Here is the log file with the error:

Code:
C:\JOBs>kix32 lclgrpmodder
GroupAdd('MOR6E6', 'MOR6E6\Power Users', 'Domain Users')
The network path was not found.
GroupAdd('MOR621', 'MOR621\Power Users', 'Domain Users')
Error (317 / 13D) while retrieving error information for 800708AC
GroupAdd('MOR661', 'MOR661\Power Users', 'Domain Users')
The network path was not found.
GroupAdd('MOR6BH', 'MOR6BH\Power Users', 'Domain Users')
The network path was not found.
GroupAdd('MOR6BR', 'MOR6BR\Power Users', 'Domain Users')
Error (317 / 13D) while retrieving error information for 800708AC
GroupAdd('MOR6D3', 'MOR6D3\Power Users', 'Domain Users')
Error (317 / 13D) while retrieving error information for 800708AC



The network path not found ones I understand (they are not on).
However, the ones that ARE on return strange errors. Is it the quotes? I have tried a bunch of different variations of Domain\Username, Workstation\Power Users, without the domain, etc.

Top
#151732 - 2005-11-17 09:11 PM Re: Errors using GroupAdd UDF
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
using the following code, we can get the decimal error numnber...
Code:
? val("&"+Right('800708AC',4))  



which yields:

2220
c:\data\scripts>net helpmsg 2220

The group name could not be found.


EXPLANATION

You specified an unknown group name.

ACTION

Check the spelling of the group name. To display a list of the groups in the security database, type:

NET GROUP


what about the "Domain Users" reference? Should it be "domain\Domain Users"


Edited by Howard Bullock (2005-11-17 09:13 PM)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#151733 - 2005-11-17 10:01 PM Re: Errors using GroupAdd UDF
jdogg Offline
Getting the hang of it

Registered: 2003-09-11
Posts: 91
Loc: RTP, North Cakalaka, USA
Ok... I think that led me in the right direction.
I think my main problem is interpreting the error msgs.
See my log file now... this first entry is when the group was not populated:
Code:
GroupAdd('MOR6H1', 'Power Users', 'BHC-NA\Domain Users')
The operation completed successfully.


That looks good, of course. If I run it again, though, it would be nice to get a friendlier message than the following:
Code:
 
C:\JOBs>kix32 lclgrpmodder
GroupAdd('MOR6H1', 'Power Users', 'BHC-NA\Domain Users')
COM exception error "Add" ((null) - (null)) [-2147352567/80020009]



In the above case it would be nice to see a "The user/group is already a member of the local group" or something similar.
Beggers can't be choosers, though, I suppose. Any other suggestions?

Top
#151734 - 2005-11-17 10:36 PM Re: Errors using GroupAdd UDF
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Lookup fnConvertCOMErr()
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#151735 - 2005-11-17 11:02 PM Re: Errors using GroupAdd UDF
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

In the above case it would be nice to see a "The user/group is already a member of the local group" or something similar.




PFFT! Are you just griping at MS or making a suggestion? Since the error is returned by MS and not KiX, I would have to assume the former. If the latter, you are on the wrong forum.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#151736 - 2005-11-17 11:25 PM Re: Errors using GroupAdd UDF
jdogg Offline
Getting the hang of it

Registered: 2003-09-11
Posts: 91
Loc: RTP, North Cakalaka, USA
Well, Les, my first post was in the right forum.
I guess I was griping in the latter reply... or asking if there is a way to get a friendlier response... in which case, Howard's reply was right on point!
Thanks Howard!

Top
#151737 - 2005-11-18 03:59 PM Re: Errors using GroupAdd UDF
jdogg Offline
Getting the hang of it

Registered: 2003-09-11
Posts: 91
Loc: RTP, North Cakalaka, USA
Hey Howard (or whoever wants to comment),

I included the fnComErr UDF, which is great, but if the group already exists when it attempts to add, it says "The storage control block is invalid".
This is much better than:
COM exception error "Add" ((null) - (null)) [-2147352567/80020009]

However it is still not descriptive of the situation.
The other errors are good... "Network path not found", and "The operation completed successfully."

I know I am being nitpicky... or I think there is another word for someone who spends too much time on small stuff.

Top
#151738 - 2005-11-18 04:17 PM Re: Errors using GroupAdd UDF
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
As I had intimated, you are griping on the wrong forum. Since Microsoft and NOT KiX generates the error, you will have to find a forum where you can bend Bill Gates and Company's ear. All KiX can do is to report what COM sends it.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#151739 - 2005-11-18 04:22 PM Re: Errors using GroupAdd UDF
jdogg Offline
Getting the hang of it

Registered: 2003-09-11
Posts: 91
Loc: RTP, North Cakalaka, USA
Duly noted Les.

*looking up Mapquest for directions to Bill Gates house*

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1471 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.062 seconds in which 0.028 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