Giter Site home page Giter Site logo

Comments (9)

mariusstrom avatar mariusstrom commented on September 26, 2024 2

thanks, I spoke with @bkoeller separately about this and I'm unblocked. The link you posted is a great link, it would be nice to reference that in the powershell scripts or documentation.

from o365-investigationtooling.

mariusstrom avatar mariusstrom commented on September 26, 2024 1

Also App Passwords fail:

PS C:\Users\USERNAME\desktop> $ExoSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $userCredential -Authentication Basic -AllowRedirection
New-PSSession : [outlook.office365.com] Processing data from remote server outlook.office365.com failed with the following error message:
[ClientAccessServer=DM5PR16CA0007,BackEndServer=HOSTNAME.namprd17.prod.outlook.com,RequestId=619f2277-6bf3-4e6b-8032-2fbf39f962ba,TimeStamp=2/27/2017 6:29:30 PM] [FailureCategory=WSMan-InvalidShellID] The request for the Windows
Remote Shell with ShellId 6FFE1BCD-1AA5-4082-AE07-6667C64AAD46 failed because the shell was not found on the server. Possible causes are: the specified ShellId is incorrect or the shell no longer exists on the server. Provide the correct ShellId or create a new shell and retry the operation. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:15

  • ... xoSession = New-PSSession -ConfigurationName Microsoft.Exchange -Conn ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
    • FullyQualifiedErrorId : CannotConnectTargetSessionDoesNotExist,PSSessionOpenFailed

from o365-investigationtooling.

mcvic1rj avatar mcvic1rj commented on September 26, 2024 1

@mariusstrom MFA for Exchange online powershell requires a specific module and you have to make a specific call to open the session. See: https://technet.microsoft.com/en-us/library/mt775114(v=exchg.160).aspx

from o365-investigationtooling.

hontoz avatar hontoz commented on September 26, 2024 1

The command also just turns into: (after you load the Exchange Online PowerShell Module)
Connect-EXOPSSession -UserPrincipalName [your o365 account]
instead of this part:

$userCredential = Get-Credential

#This gets us connected to an Exchange remote powershell service
$ExoSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $userCredential -Authentication Basic -AllowRedirection

Import-PSSession $ExoSession

from o365-investigationtooling.

mcvic1rj avatar mcvic1rj commented on September 26, 2024

Do you have the EXO Powershell module installed?

from o365-investigationtooling.

mariusstrom avatar mariusstrom commented on September 26, 2024

@mcvic1rj don't believe so. I didn't see anything in the EnableMailboxAuditing.ps1 or README that mentioned installing additional modules as a prereq.

all the commands in EnableMailboxAuditing.ps1 are available in my PowerShell, so I'd be surprised if there are additional modules needed though.

from o365-investigationtooling.

Kazzan avatar Kazzan commented on September 26, 2024

It looks also like this issue - https://support.microsoft.com/en-my/help/3090768/invalidshellid-error-in-rps-in-office-365-dedicated-itar

from o365-investigationtooling.

TiloGit avatar TiloGit commented on September 26, 2024

try:

Connect-EXOPSSession -UserPrincipalName YourAdminUser@mydom.com

check: https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/mfa-connect-to-exchange-online-powershell?view=exchange-ps

from o365-investigationtooling.

PsychoData avatar PsychoData commented on September 26, 2024

To Enable MFA, you need to have the Exchange Online Powershell Module, as others mentioned. You can get it here. https://aka.ms/ExoPSHybrid

However, you need to either open the Exchange Online Powershell Module from your Start menu (or the link) each time you want to connect to that exchange online powershell to do it properly.
The actual Connect-EXOPSSession -UserPrincipalName [email protected] won't work unless you have opened the Application, because it hasn't been defined yet.

Or, once the .Application is installed, you can do a halfway version by running the below

Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch "_none_"}| sort LastWriteTime -Descending | select -First 1)

$EXOSession = New-ExoPSSession -UserPrincipalName ("$UserPrincipalName")
Import-PSSession $EXOSession -AllowClobber

This halfway version isn't as good at the reconnection process, and won't reconnect as well as the proper .Application version if left idle, but it's good enough for that one-off when you already have all of the variables you need in your current session.

from o365-investigationtooling.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.