Important Notice: On February 29th, this community will be put into read-only mode. All existing posts will remain but customers will be unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Get AD User's Groups (Remote LoggedOnUser)


A simple tool I use to check the AD Groups of a LoggedOnUser, on a Remote Computer.


#Recuperation Username distant :
$user = (Get-WmiObject -ComputerName $(Computer:TARGETHOSTNAME) -Class win32_computersystem).username.split("\")[1]

#On cherche et affiche les groupes AD :
$ADUserInfo = Get-ADUser $user -Properties *
Write-Host "L'utilisateur $user est membre des groupes :" -ForegroundColor Cyan


Screenshots :





Please sign in to leave a comment.

Didn't find what you were looking for?

New post