Announcement

Collapse
No announcement yet.

Export\Extract DistributionLists

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Export\Extract DistributionLists

    I'm trying to extract all distribution lists within an OU with the members, member of and managed by fields listed in csv format. Is there anyway to do this via csvde, I've tried a few things and just can't get it working, if someone could provide the code that would be appreciated.

    Thanks

  • #2
    Re: Export\Extract DistributionLists

    Originally posted by tradu81 View Post
    I'm trying to extract all distribution lists within an OU with the members, member of and managed by fields listed in csv format. Is there anyway to do this via csvde, I've tried a few things and just can't get it working, if someone could provide the code that would be appreciated.

    Thanks
    Its probably easier to use PowerShell than CSVDE.

    Firstly a look at this very handy utility that Andy Grogan has developed:

    http://www.telnetport25.com/2013/01/...ing-tool-dlrt/

    Secondly i have a .vbs script that can do some of what you want. You may need to modify some of the code though to include 'Managed by' and 'Member of'.

    ************************************************** ***********
    'Script begins here

    Dim objGroup, objUser, objFSO, objFile, strDomain, strGroup, Domain, Group

    'Change DomainName to the name of the domain the group is in

    strDomain = Inputbox ("Enter the Domain name", "Data needed", "Default domain name")

    'Change GroupName to the name of the group whose members you want to export

    strGroup = InputBox ("Enter the Group name", "Data needed", "Default group name")

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    'On the next line change the name and path of the file that export data will be written to.

    Set objFile = objFSO.CreateTextFile("C:\" & strGroup & " - Members.txt")

    Set objGroup = GetObject("WinNT://" & strDomain & "/" & strGroup & ",group")

    For Each objUser In objGroup.Members

    objFile.WriteLine objUser.Name & " - " & objUser.Class

    Next

    objFile.Close

    Set objFile = Nothing

    Set objFSO = Nothing

    Set objUser = Nothing

    Set objGroup = Nothing

    Wscript.Echo "Done"

    Wscript.Echo "Please check the c: for your output file"
    ************************************************** ************

    Comment


    • #3
      Re: Export\Extract DistributionLists

      Thank you.

      Comment

      Working...
      X