I am trying to create a script to query AD groups to pull back the users part of that group. I can currently do it if i hard code the group into the script but i am looking to make it user interactive by allowing the user to enter the AD group the are looking for.
I have tried using Read-Host to enter the variable to pull back but it doesn't pull back no results but if i hard code it it does.
$group = Read-Host 'Please enter a AD Group!' Get-ADGroupMember -identity '$group' -Recursive | Get-ADUser -Property DisplayName | Select SamAccountName,Name,ObjectClass