SelfAssigned Scripts to 035

Welcome Forums General PowerShell Q&A SelfAssigned Scripts to 035

This topic contains 2 replies, has 2 voices, and was last updated by

2 years, 6 months ago.

  • Author
  • #38165

    Points: 0
    Rank: Member

    I recently made changes to Set-ExecutionPolicy to AllSigned. I am using self assigned singature and trying to run the follow signed script.

    **** Connect to Office 365 ****

    $LiveCred = Get-Credential
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LiveCred -Authentication Basic -AllowRedirection

    Import-PSSession $Session

    Get-DistributionGroupMember -Identity "accounting"

    The error I am seeing after I type in my credentials to Office 365 are as follows:

    WARNING: Your connection has been redirected to the following URI: "
    l-LiveID?PSVersion=4.0 "
    Import-PSSession : Files cannot be loaded because running scripts is disabled on this system.
    Provide a valid certificate with which to sign the files.
    At C:\foo.ps1:7 char:1

    Can you used self assign scripts with o365?

    Thank you

  • #38168

    Points: 1,624
    Helping HandTeam Member
    Rank: Community Hero

    That's because it's attempting to implicitly remote the O365 commands into your system, and the resulting shadow module doesn't get signed. Not really a workaround for that.

    And even so, a self-signed certificate does nothing for you in terms of security. It isn't trusted, you can't manage revocation, etc. If you're just going to used self-signed, you're pretty much wasting your time with it from a security and integrity perspective anyway.

  • #38173

    Points: 0
    Rank: Member

    Thank you for the information. I expected you to say the things you have just wanted to verify it.

    I have some research to do now.

The topic ‘SelfAssigned Scripts to 035’ is closed to new replies.