Hi @Mohd Arif ,
You can convert your Excel file to CSV, this is easly done:
Convert Excel file (XLSX) to CSV in Powershell
https://excel.officetuts.net/examples/convert-excel-file-xlsx-to-csv-in-powershell/
Depending on how your CSV is exactly structured (in particular the headers) you need to do the following:
$Groups = Import-CSV "Path top the CSV" -Header "Column1","Column2"
Here a reference regarding the import:
Afterwards you can loop over the groups and get their members:
foreach ($Group in $Groups) {
Get-ADGroupMember -identity $Grooup | select DisplayName, name, samaccountname | Export-csv -path c:\filename.csv -Notypeinformation
}
You have to just see test it out, but the approach is prettyy straight forward.
Hope I was able to help.
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Stoyan Chalakov