none
How to list active users and groups named GroupName* the user NOT belongs to and export to CSV RRS feed

  • Question


  • Hello!

    We have several AD global groups groups following a name convention, and the groups are:

    gg-System-Name1

    gg-System-Name2

    gg-System-Name3

    gg-System-Namex...

    It has been requested to generate a CSV listing of active users that do NOT belong to these groups

    it´s possible to do, using VBS or PowerShell?


    I found a very clever script in:

    https://community.spiceworks.com/topic/1956203-export-list-of-each-user-w-group-memberships-powershell

    get-aduser -filter * -Properties name,memberof |select name, @{n=’MemberOf’; e= { ( $_.memberof | % { (Get-ADObject $_).Name }) -join “,” }} | export-csv c:\users.csv -nti

    Using this, i was able to export do MS Excel and remove the information i don´t want, so it´s a matter of including a filter to Enable $TRUE  and looking for groups whose names does not begin with gg-System-Name*


    • Edited by KayZerSoze Wednesday, February 19, 2020 8:31 PM typo
    Wednesday, February 19, 2020 8:04 PM

All replies