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." wscript.quit else if err.number <> 0 then '***Catch any other errors and display the error number and description msgbox err.number & " - " & err.description wscript.quit end if end if 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 else oOutput.writeline "," & oUser.firstname & " " & oUser.lastname & "," & sOU & "," & user.shortname end if else oOutput.writeline "," & oUser.fullname & "," & sOU & "," & user.shortname end if if err.number <> 0 then ' msgbox err.number & vbcrlf & err.description err.clear end if on error goto 0 next oOutput.close msgbox "Done"
Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment. It just worked for at least one person, and perhaps it will be useful for you too. Be sure to test in a non-production environment.