Solved

get-aduser

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

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 84

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
A brief introduction to what I consider to be the best editor for PowerShell.
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 …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

839 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