What I am trying to do is have a script that will look into ad for a specific OU that is specified. Output the OU name, username of the users in the OU and the display name of the user to a CSV file. I can get the output of the OU name and username but the display name isn’t working. My thoughts on this is that some of the users are in a different domain we have a 1 way trust relationship. If its not possible to get the display names of the users from the other domain I will need a way to put some exception where it just leaves it blank for those users. This is what I have so far as my code.
Get-ADGroupMember doesn’t return the DisplayName property. You’ll need to pipe into Get-ADUser to get more attributes of the user which should work across domain/forest trusts.
It worked. Thanks Daniel. I been working on this for months. Programming with powershell has never been my strong point. If there are any books or videos any of you suggest to get better at this let me know.
Yes, I can recommend investing the time to watch the following video courses and buy/read/browse through Don’s book “Learn Windows PowerShell in a Month of Lunches”.