I have multiple domains on my server. I need to check whether a user is a member of which group using powershell.
When i try :-
Import-Module ActiveDirectory (GET-ADUSER –Identity "Account name" -Server $Domain –Properties MemberOf | Select-Object MemberOf)
I can do this using the above code, but on some of the servers, the AD module is not installed, hence cannot import AD module for those, so is there any other way to get the same info?