Pau Lo
asked on
combining get-adgroupmember and get-aduser info into a single report
would there be an easy way to merge the output of get-adgroupmember with some of the attributes of get-aduser? I basically need to verify a number of group members but being able to write them out to a csv type report and also pull in a number of get-aduser attributes, e.g. enabled, accountexpirydate etc would really help with this exercise.
What I am suggesting is I want to specify get-adgroupmember group, and the output be written to CSV in a table format, which of course will show all group members, but then also include some attributes about the aduser, namely attributes: enabled, email address, accountexpirydate, lastlogintimestamp. By default get-adgroupmember only returns these attributes per group member which isn't quite enough:
Not sure if there's anyway to amend the output of cmdlet get-adgroupmember itself to show other user attributes to avoid having to merge the output of 2 commands. I suppose I could run 2 commands and join them into something like access, but an all in one way in PowerShell would be ideal to save time.
What I am suggesting is I want to specify get-adgroupmember group, and the output be written to CSV in a table format, which of course will show all group members, but then also include some attributes about the aduser, namely attributes: enabled, email address, accountexpirydate, lastlogintimestamp. By default get-adgroupmember only returns these attributes per group member which isn't quite enough:
- distinguisedname
- name
- objectclass
- objectGUID
- SamAccountName
- SID
Not sure if there's anyway to amend the output of cmdlet get-adgroupmember itself to show other user attributes to avoid having to merge the output of 2 commands. I suppose I could run 2 commands and join them into something like access, but an all in one way in PowerShell would be ideal to save time.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.