Implicit remoting, module import errors out

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

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 6 years and 6 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.
User avatar
jackieboy64
Posts: 9
Last visit: Wed Aug 30, 2017 12:29 am

Implicit remoting, module import errors out

Post by jackieboy64 »

Product, version and build: powershell studio 2012 3.1.35
32 or 64 bit version of product: 64bit
Operating system: Windows 7 home premium
32 or 64 bit OS: 64bit

When I run the below code in Powershell Studio I get an arror while trying to import the modules. When I copy the three commands and take them to the ISE or PowerGui the commands run just fine and the module is imported. I'm totally stuck here.

Code: Select all

$cred = Import-Clixml ${env:localappdata}\creds.xml
$ADCommands = New-PSSession -ComputerName "server01.lab.mydomain.com" -Credential $cred -Authentication "Credssp"
Import-Module -PSSession $ADCommands activedirectory
ERROR: Import-Module : Failure from remote command: Import-Module -Name 'activedirectory': Het doel van een aanroep heeft een uitzondering veroorzaakt.
Globals.ps1 (7): ERROR: At Line: 7 char: 1
ERROR: + Import-Module -PSSession $ADCommands activedirectory
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : NotSpecified: (:) [Import-Module], InvalidOperationException
ERROR: + FullyQualifiedErrorId : PSRemotingTransportException,Microsoft.PowerShell.Commands.ImportModuleCommand
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Implicit remoting, module import errors out

Post by davidc »

What version of PowerShell ($PSVersionTable) do you have installed locally and on the remote machine? Note: PowerShell Studio 2012 is a really old version of the product and doesn't support later versions of PowerShell.

I also recommend checking the platform settings. For example, 32-bit vs 64-bit.
David
SAPIEN Technologies, Inc.
User avatar
jackieboy64
Posts: 9
Last visit: Wed Aug 30, 2017 12:29 am

Re: Implicit remoting, module import errors out

Post by jackieboy64 »

Hi David,

PSversion to new? I would consider that a plausible cause If it had never worked.
However it has been working before. One day I was using it the other day it spits errors at me.
Every time the (empty) progress bar shows me it's at 75% but then the error pops up.
Because I'm using the home edition it's not possible for me to install RSAT tools. So I have to
implicitly remote to the server.

I work in 64bit STA, v3 mode whenever I can but I tried all other settings too.

Here is my desktops version:
Name Value
---- -----
PSVersion 5.1.14409.1012
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1012
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

And here's my servers version:
Name Value
---- -----
PSVersion 5.1.14409.1005
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1005
CLRVersion 4.0.30319.34209
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Kind regards,

Jack
User avatar
jackieboy64
Posts: 9
Last visit: Wed Aug 30, 2017 12:29 am

Re: Implicit remoting, module import errors out

Post by jackieboy64 »

A little update on this problem,

when I build the project it runs like a charm. I'm officially confused.

Kind regards,

Jack
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Implicit remoting, module import errors out

Post by davidc »

In 2012, you have to make sure you use the project menu instead of the file menu. Otherwise I’m not sure why the error occurred.
David
SAPIEN Technologies, Inc.
This topic is 6 years and 6 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.