Comments (9)
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.
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.
@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.
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.
Do you have the EXO Powershell module installed?
from o365-investigationtooling.
@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.
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.
try:
Connect-EXOPSSession -UserPrincipalName YourAdminUser@mydom.com
from o365-investigationtooling.
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)
- DumpDelegatesandForwardingRules doesn't have target of Get-InboxRule in output HOT 2
- Update EnableMailboxAuditing.ps1 HOT 1
- EnableMailboxAuditing.ps1 add SchedulingMailbox type HOT 4
- unapproved verbs & UseDatabaseQuotaDefaults
- inactiveInLastThreeMonthsUsers HOT 1
- WARNING: Proxy creation has been skipped for the following command:
- Script Times Out When Running Against 5000 Users HOT 1
- Set up all scripts to work from docker
- Legacy authentication turned off HOT 3
- Too many result than Azure AD Admin Center showed HOT 2
- DumpDelegatesandForwardingRules.ps1 trouble running on Exchange Online Powershell Module with MFA
- Are these being updated? HOT 3
- EnableMailboxAuditing.ps1 suggest HOT 1
- EnableMailboxAuditing.ps1 missing ? HOT 1
- How can I decrypt the action and condition fields HOT 2
- Broken link in documentation
- pulling a lot of active accounts HOT 3
- "The account does not have permission to impersonate the requested user."
- InactiveUsersLast90Days.ps1 - limit of 5000 audit log items
- InactiveUsersLast90Days.ps1 - UserLoginFailed events
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from o365-investigationtooling.