- This topic has 1 reply, 2 voices, and was last updated 2 months, 2 weeks ago by
June 28, 2020 at 5:17 pm #238754ParticipantTopics: 68Replies: 72Points: 543Rank: Major Contributor
I have a server that is running in Constrained Language Mode which is enforced via GPO. I have a script which I have signed and will run if I run on the server.
PS C:\Utility> hostname
PS C:\Utility> $ExecutionContext.SessionState.LanguageMode
PS C:\Utility> .\TestScript.ps1
I am trying to run this same script from a remote server from which I have domain admin credentials to authenticate with. The error comes back that it is in the Constrained Language mode.
Is there a way to accomplish the execution of this signed script in this fashion? Want to run a similar script on multiple servers.
PS H:\Scripts> Invoke-Command -ComputerName w19-sanfe02 -FilePath .\TestScript.ps1 -Credential XXXX\brian.clanton
Cannot invoke method. Method invocation is supported only on core types in this language mode.
+ CategoryInfo : InvalidOperation: (:) , RuntimeException
+ FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage
+ PSComputerName : w19-sanfe02
July 3, 2020 at 4:07 pm #240116
- You must be logged in to reply to this topic.