Solved

get-aduser

Posted on 2016-09-05
2
173 Views
Last Modified: 2016-10-03
I am trying to run some shell commands on a PC joined to one domain, where there is a trust between this domain and another.. Is there anyway to specify a server command to make sure this shell command is running against a DC in another domain?
0
Comment
Question by:pma111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Assisted Solution

by:Dan McFadden
Dan McFadden earned 250 total points
ID: 41784618
Provided you have the necessary permissions on the remote server, you can use one of these two methods:

1. Invoke-Command
--- https://technet.microsoft.com/en-us/library/hh849719(v=wps.630).aspx
2. New-PSSession
--- https://technet.microsoft.com/en-us/library/hh849717(v=wps.630).aspx

Links assume PowerShell v4.0

Dan
0
 
LVL 85

Accepted Solution

by:
oBdA earned 250 total points
ID: 41784630
No need for the heavy artillery here.
You can simply use Get-ADUser's "-Server" argument and specify the FQDN of the DC in the trusted domain. If necessary, you can use the "-Credential" argument to specify credentials for the other domain as well.
Get-ADUser -Filter * -Server TrustedDC.trusted.domain.com

Open in new window

0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question