Solved

get-aduser

Posted on 2016-09-05
2
48 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
2 Comments
 
LVL 26

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 83

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now