Hi everyone, I would need to convert the primary group ID to the corresponding sAMAccountName, but I can’t find anything.
With the script below I get the primary group ID, but I would need to get the sAMAccountName which corresponds to “UOC Gestione delle Infrastrutture Tecnologiche”
Get-AdUser -identity Perry -Properties PrimaryGroupID | select PrimaryGroupID
Yessss…it works perfectly.
I need to use the sAMAccountName because for the mappings we read an ini file, and for each mapping the sAMAccountName of the group to which the user belongs is defined.
I thank you
G