Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Change domain using powershell

$
0
0

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  'sam' 

I get an error:-
Get-ADUser : Cannot find an object with identity: 'sam' under: 'DC=ad,
DC=company,DC=com'.

Actually, the user 'sam' exists in some other domain in Active directory, So How do I connect to a particular domain, have the script to look for 'sam' in the domain i connect to, and list the "member of" 'sam'?




Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>