Solved

get-aduser

Posted on 2016-09-05
2
59 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article will help you understand what HashTables are and how to use them in PowerShell.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

895 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

11 Experts available now in Live!

Get 1:1 Help Now