That description is actually not that helpful. What exactly happens? Do you get any error messages?
Have you considered using a native PowerShell command instead? As there is
… you don’t need the external tool djoin.exe.
Regardless of that … PowerShell is - just like CMD - a command line shell. So at the moment you’re using one command line shell to call another command line shell to call an external executable. I urgently recommend to re-consider that process.
And last but not least - when you post code, error messages, console output or sample data please format it as code using the “preformatted text” button ( </> ).
Thanks for the response Olaf. I’m adding this computer via the Internet so after the file is generated from the djoin command I run another djoin from the remote computer which talks to my DirectAccess server over https. I don’t think Add-Computer will work in this instance.
I don’t get an error when the djoin command is run. It appears that it’s just not running at all.
Should I use invoke-command multiple times, one for each command?
I would ensure you’re not running into the common double hop issue. To even query AD from a remote machine via invoke-command, you’ll not be able to make that second hop without passing creds, using credssp, or other work arounds.