Maand: maart 2023

Assuming that you have the ActiveDirectory module installed, you can use the following one-liner to get the group membership information for a specific user in Active Directory and filter the results based on a specific naming pattern:   Get-ADPrincipalGroupMembership -Identity ‘username’ | Where-Object { $_.Name -like “*pattern*” } | Select-Object Name   Replace username with […]

Meer lezen

To display the members of a group in Active Directory with their full name in a single line, you can use the following PowerShell command: Powershell Get-ADGroupMember “Group Name” | ForEach-Object {Get-ADUser $_.samaccountname -Properties DisplayName | Select-Object -ExpandProperty DisplayName} | Out-String -Width 4096 Replace “Group Name” with the name of the group you want to […]

Meer lezen