Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

get-aduser

Posted on 2016-09-05
2
Medium Priority
?
227 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 1000 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 1000 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

A hard and fast method for reducing Active Directory Administrators members.
Let's recap what we learned from yesterday's Skyport Systems webinar.
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 …
Suggested Courses

688 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