Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4104292
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:05:59+00:00 2026-05-20T21:05:59+00:00

I am connecting to Exchange 2010 for Live@edu via PowerShell. I can connect using

  • 0

I am connecting to Exchange 2010 for Live@edu via PowerShell. I can connect using the standard methods just fine. However, downloading and importing the session commands every time seems wasteful, especially since this isn’t on a LAN. Furthermore, occasionally, these scripts are going to be returning data to a web page, and the import time seems wasteful there as well.

I have found how to export the session using the Export-PSSession cmdlet. If I import that exported module with Import-Module, everything works correctly, except for one problem. When I run a cmdlet from the module, it expects me to interactively, via a GUI, set the password. What I really want is for my scripts to run in a non-interactive manner, but yet load the module locally.

Is this possible to do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:06:00+00:00Added an answer on May 20, 2026 at 9:06 pm

    The problem you are facing is that you need to be able to set the PSSession for all of the imported functions implicitly. To do that you need to be able run the Set-PSImplicitRemotingSessionfunction.

    Unfortionatly that function is not being exported so you cannot access it. What you need to do to resolve this is crack open the PSM1 file and add that function to the end of $script:ExportModuleMember. Now when you import the module that function will be abilable to set your PSSession for all of the functions.

    Here is what your powershell or scripts will need to run to be able to use any of the imported modules.

    Import-Module "C:\Credentials.psm1"
    Import-Module "C:\ExportedPSSession.psm1"
    $Cred = Import-Credential -path C:\Cred.xml
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://ps.outlook.com/powershell/" -Authentication Basic -AllowRedirection -Credential $Cred
    Set-PSImplicitRemotingSession -PSSession $Session -createdByModule $True
    #You can now run any of the imported functions.
    

    Credentials.psm1 Beware! Anyone who can load the xml file can now impersonate you!

    function Export-Credential($cred, $path) {    
      $cred = $cred | Select-Object *    
      $cred.password = $cred.Password | ConvertFrom-SecureString
      $obj = New-Object psobject
      $obj | Add-Member -MemberType NoteProperty -Name UserName -Value $cred.username
      $obj | Add-Member -MemberType NoteProperty -Name Password -Value $cred.password
      $obj | Export-Clixml $path
    }
    
    function Import-Credential($path) {    
      $obj = Import-Clixml $path    
      $obj.password = $obj.Password | ConvertTo-SecureString
        return New-Object system.Management.Automation.PSCredential( $obj.username, $obj.password)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im connecting to a webmail (Exchange 2003) via IMAP. Im using a library from
I have the following code to connect to my office 365 account using powershell:
Exchange Autodiscovery will give me the user's Display Name via the UserSettingName.UserDisplayName property. However,
I have someone connecting to my repository using the url (substituted the IP address):
I'm having trouble connecting (via the Socket and XMLSocket classes) to a TCP listener
I have Xdebug 2.1 installed, and running with PHP 5.2.13. It can successfully connect
I’m converting an existing piece of code using Redemption (an MS Exchange library) to
Summary: I am having trouble connecting to an exchange 2007 mailbox that is running
I have a problem connecting to any serial port (want to exchange with an
I want to read my emails from ms exchange, I am using java mail

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.