A quick and easy way to list all the members of a group object, including the user’s full name, and outputting the list to a csv file. This allows you to provide the list of real names to a manager/supervisor/<fill in the blank> and not expect them to recognize people by their username.
This vbscript requires nwdirq.dll and nwusrgrp.ocx from the active_ndap NDK (http://developer.novell.com/wiki/index.php/Activex_ndap) to be registered on the workstation.
This script will list all the users in a specified Group (the output is Full Name, OU the account is in, username) to a csv file.
set oFso = createobject("scripting.filesystemobject")
set oNWDirq = createobject("nwdirquerylib.nwdirquery.1")
set oNWUsrGrp = createobject("nwusrgrplib.nwusrgrpctrl.1")
cOutput1 = "c:\temp\GroupMembership-"
cOutput2 = ".csv"
sGroup = inputbox("What is the name of the group that you would like to list the members of?")
oNWUsrGrp.fullname = "NDS:\\---your tree name---\---your O name---\---OU that contains your groups---"
'*** Error trapping to catch cases where the group does not exist
'*** in the branch that the user selected
on error resume next
set oGroup = oNWUsrGrp.groups.item(oNWUsrGrp.fullname & "\" & sGroup)
if err.number = 52958 then
msgbox "The group does not exist in the " & sBranch & " branch of the tree."
if err.number <> 0 then '***Catch any other errors and display the error number and description
msgbox err.number & " - " & err.description
on error goto 0 '***Turns of "on error resume next"
set oOutput = oFso.opentextfile(cOutput1 & sBranch & "-" & sGroup & cOutput2, 2, true)
oOutput.writeline "Branch & Group Name,Full Name,OU,Account"
oOutput.writeline sBranch & " - " & sGroup
set oGroupMembers = oGroup.groupmembers
for each user in oGroupMembers
sOU = replace(user, "\" & user.shortname, "")
oNWUsrGrp.fullname = sOU
set oUser = oNWUsrGrp.users.item(oNWUsrGrp.fullname & "\" & user.shortname)
sOU = replace(sOU, "NDS:\\---your tree name---\", "")
on error resume next
if isnull(oUser.fullname) then
if isnull(oUser.firstname) then
oOutput.writeline ",**** " & oUser.lastname & "," & sOU & "," & user.shortname
oOutput.writeline "," & oUser.firstname & " " & oUser.lastname & "," & sOU & "," & user.shortname
oOutput.writeline "," & oUser.fullname & "," & sOU & "," & user.shortname
if err.number <> 0 then
' msgbox err.number & vbcrlf & err.description
on error goto 0
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.