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.