SAPIEN PS Studio 2022 - issues with JEA endpoint

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 2 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
Maltacwie
Posts: 15
Last visit: Fri Feb 24, 2023 12:46 pm

SAPIEN PS Studio 2022 - issues with JEA endpoint

Post by Maltacwie »

Hi, I have an issue with JEA endpoint - repadmin /replsingleobj ... command works from standard PowerShell console (Invoke-Command) but not as same code under GUI tool:

I always get an error:

The syntax is not supported by this runspace. This can occur if the runspace is in no-language mode.

What can I do here?
by jvierra » Mon Jan 24, 2022 2:12 pm
The issue is similar to the double hop issue. The remote command session ends before the command finishes executing.\

Open a persistent session to the remote system then execute the command. Wait for completion and then close the remote session.

Also note that AD management commands are not d3esigned to be remoted, that is why the AD tools can be installed on any computer in the network.

Also most AD tools require a visble console and will often fail when run with no UI. I suspect that this command will not run with no UI. A runspace has no UI.
Go to full post
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: SAPIEN PS Studio 2022 - issues with JEA endpoint

Post by Alexander Riedel »

You need to contact the folks who created that endpoint. The error basically means you can use a command from a console but not from within a script or code block.
Alexander Riedel
SAPIEN Technologies, Inc.
Maltacwie
Posts: 15
Last visit: Fri Feb 24, 2023 12:46 pm

Re: SAPIEN PS Studio 2022 - issues with JEA endpoint

Post by Maltacwie »

I created that endpoint and allowed repadmin as visible external command. From PS console Invoke-Command -ComputerName DCName -ConfigurationName ConfigName -ScriptBlock {repadmin /replsingleobj ...} works but same code in PS Studio throws this error having clicked on GUI command button.

What is the difference between Invoke-Command from standard built-in PS console and Invoke-Command as code in PS Studio executing on command button click? Endpoint they use is the same ... Session type I use for all endpoints is RestrictedRemoteServer as recommended.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: SAPIEN PS Studio 2022 - issues with JEA endpoint

Post by Alexander Riedel »

[Topic moved by moderator]
Alexander Riedel
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: SAPIEN PS Studio 2022 - issues with JEA endpoint

Post by jvierra »

The issue is similar to the double hop issue. The remote command session ends before the command finishes executing.\

Open a persistent session to the remote system then execute the command. Wait for completion and then close the remote session.

Also note that AD management commands are not d3esigned to be remoted, that is why the AD tools can be installed on any computer in the network.

Also most AD tools require a visble console and will often fail when run with no UI. I suspect that this command will not run with no UI. A runspace has no UI.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: SAPIEN PS Studio 2022 - issues with JEA endpoint

Post by jvierra »

Note also that PowerShell has CmdLets that manage replication administration.

https://www.microsoft.com/en-us/downloa ... x?id=28972

https://docs.microsoft.com/en-us/window ... level-200-
Maltacwie
Posts: 15
Last visit: Fri Feb 24, 2023 12:46 pm

Re: SAPIEN PS Studio 2022 - issues with JEA endpoint

Post by Maltacwie »

Thank you very much, persistent session made all difference.
Last edited by Maltacwie on Tue Jan 25, 2022 12:11 am, edited 1 time in total.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: SAPIEN PS Studio 2022 - issues with JEA endpoint

Post by jvierra »

Then you won't be able to do what you are trying to do. You have to run repadmin locally which requires installing RSAT tools but does not re3quire ADWS to be installed on AD.

If you have doubts, then I recommend posting in the AD admin forum on Microsoft and they will explain the limits and requirements for remote administration.

Either run with a full UI locally or enable AWS on at least one AD node.

In the end you are running up against security restrictions on AD and remoting as well as authentication issues. If this is required by your company then the AD admins will have to give you the access you need as a minimum requirement.
This topic is 2 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked