'===================== Set wshNetwork = WScript.CreateObject( "WScript.Network" ) strUserDomain = wshNetwork.UserDomain strUserComputer = wshNetwork.ComputerName strUserName = wshNetwork.UserName strGroup = InputBox("Please type the AD group name to get members of:", "Group Name", "mf_users") Set objWinntObject = GetObject("WinNT://" & strUserDomain & "/" & strGroup) strResults = "Results" & VbCrLf & "=======" strResults = strResults & VbCrLf & "Group: " & objWinntObject.Name strMembers = GetMembers(GetObject("WinNT://" & strUserDomain & "/" & objWinntObject.Name)) strResults = strResults & VbCrLf & strMembers & VbCrLf Set objFSO = CreateObject("Scripting.FileSystemObject") Set objOutputFile = objFSO.CreateTextFile("DomainGroups.txt", True) objOutputFile.Write strResults objOutputFile.Close Set objOutputFile = Nothing Set objFSO = Nothing MsgBox "Done. Please see output text file." Function GetMembers(objGroup) strMembers = "" For Each objMember In objGroup.Members If strMembers = "" Then strMembers = objMember.Name Else strMembers = strMembers & VbCrLf & objMember.FullName End If Next GetMembers = strMembers End Function '=====================
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE