PowerShell 7.3 - implementing Retrieving Active Directory Users with Specific Attributes Using Get-ADUser
I'm not sure how to approach I'm maintaining legacy code that I'm stuck on something that should probably be simple... This might be a silly question, but I'm trying to use the `Get-ADUser` cmdlet in PowerShell 7.3 to retrieve a list of Active Directory users along with specific attributes like `Department` and `Title`. However, I'm working with issues where it seems to return only the default properties and not the ones I'm interested in. I've tried specifying the `-Properties` parameter, but I still get unexpected results. Here's the code snippet I'm using: ```powershell $users = Get-ADUser -Filter * -Properties Department, Title $users | Select-Object Name, Department, Title ``` When I run this, I only see the `Name` property listed in the output. I'm also getting warnings like `Get-ADUser : Some properties could not be retrieved because access was denied` for certain users, which I suspect is part of the question. I've verified that I have the necessary permissions to read those attributes but still encounter this scenario. Is there a way to ensure that I'm able to retrieve these properties reliably? Any insights or alternative methods would be greatly appreciated! This is part of a larger service I'm building. I'm working on a service that needs to handle this. What's the best practice here? This is part of a larger service I'm building. Has anyone else encountered this? I'm working with Powershell in a Docker container on Debian. The project is a mobile app built with Powershell. Is there a better approach?