Cannot get PSS to recognize Exchange connection or Module

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 5 years and 5 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.
trevath
Posts: 1
Last visit: Thu Oct 03, 2019 1:52 pm

Cannot get PSS to recognize Exchange connection or Module

Post by trevath »

Product, version and build: PowerShell Studio 2018 v5.5.155.0
32 or 64 bit version of product: 32
Operating system: Win7
32 or 64 bit OS: 32

$PSVersionTable:
Name Value
---- -----
PSVersion 3.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 6.2.9200.22198
PSCompatibleVersions {1.0, 2.0, 3.0}
PSRemotingProtocolVersion 2.2

PowerShell ISE $Profile connection script (which works completely fine):

Code: Select all

$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionURI http://ServerURL/PowerShell -Authentication Kerberos
Import-PSSession $s
***Running all as Administrator

===========================================

I've been trying to get PSS to run exchange commands since I purchased the product a couple of weeks ago, and have not been successful. I've scowered these forums to no avail, I've Googled, and Google brings me back to these forums.

I've tried the following from this post: https://www.sapien.com/forums/viewtopic.php?f=12&t=12621&p=67858&hilit=%24profile#p67858

1) Load ISE and get temp filename for the module
2) Open PSS, On the Home tab, Edit Cache
3) In the Cache Editor, Import Module
4) Browse to temp filename for the .psd1 (in both my appdata\local\temp folder, as well as a saved copy on my Desktop)
5) Once I see it in the list (it even has a description of 'Implicit remoting for http://ServerURL/PowerShell' - same URL as in $Profile) I ensure it's checked off
6) Clicked on Build Cache and then close window
7) Refreshed Cache with the little green recycle-looking button on home tab
8) Edit Cache again to confirm temp is still there and checked

After all of this, including using the New-PSSeission connection as above included right in my .ps1 script (which only ends up loading a new temp .psd1), I cannot get it to recognize exchange commands like get-mailbox. PrimalSense doesn't see it, and even running it with Shift-F8 it gives me 'not recognized as the name of a cmdlet...'

Why does this $400 program make it so difficult when you can get it running in ISE so easily? Even the actual console in PSS works fine, but the actual New PowerShell Script and PrimalSense just won't see it

Can anyone please tell me what I'm missing here?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Cannot get PSS to recognize Exchange connection or Module

Post by davidc »

Please answer the following questions so that I can assist you further:

1. What version of the Exchange snapin is installed?
2. Since you as using New-PSSession, Is the snapin is installed on a remote machine or locally?

If the module is installed on a remote machine, you can export the cache from that machine and import it into PowerShell Studio. Please refer to the following articles:

https://www.sapien.com/blog/2018/09/20/powershell-studio-working-with-remote-systems-part-1/
https://www.sapien.com/blog/2018/09/24/powershell-studio-working-with-remote-systems-part-2/

https://www.sapien.com/blog/2012/10/15/developing-powershell-scripts-for-other-machines-part-1/
https://www.sapien.com/blog/2012/10/16/developing-powershell-scripts-for-other-machines-part-2/

The CacheExport tool is located in PowerShell Studio's directory, under Redistributables.

You can also use the Cache Editor to include modules that aren't installed locally, but if you hit the Refresh button in PowerShell Studio, it will undo any changes made in the Cache Editor.
David
SAPIEN Technologies, Inc.
This topic is 5 years and 5 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.