So here's my issue.
A company we acquired uses a jump box. Which is a server that I need to access to be able to jump to other server.
So I'm running a script to enter the jumpbox, and then run get-aduser to access 3 other domains that are accessible by this server.
If i use mstsc to remote into the box, i can run the command:
get-aduser -filter * -server firstdomain.com
this runs fine, and gathers all the users. However, if i run a script that uses psremoting, and then try to run the command above - it returns an error stating that it cannot find the server. The commands look like this:
enter-pssession -computer 10.0.2.70 -credential (get-credential)
The command line changes to indicate that future commands are run through the server i've remoted into.
[10.0.2.70]: PS C:\windows\system32> get-aduser -filter * -server firstdomain.com
this returns the error stating that it cannot find the server. Any ideas?