jborean93 / omi

Open Management Infrastructure
Other
111 stars 13 forks source link

Fedora 35 recent update broke WSMan (I believe) #56

Open Clifra-Jones opened 2 years ago

Clifra-Jones commented 2 years ago
SUMMARY

After a recent update of Fedora 35* the EXO module stopped working. Updating the EXO module to 3.0 fixed the Exchange Commands because 3.0 uses REST now.

The Security and Compliance commands still use WSMan. When trying to connect to Security and Compliance I get the following error:

Connect-IPPSSession -UserPrincipalName xxxxxxxxxxxx@xxxxxxx.onmicrosoft.com             
ResourceUnavailable: Processing data from remote server ps.compliance.protection.outlook.com failed with the following error message:
ERROR_WSMAN_INVALID_SELECTORS: The WS-Management service cannot process the request because the request contained
invalid selectors for the resource.  For more information, see the about_Remote_Troubleshooting Help topic.
MODULE VERSION
ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.3.0                 PSWSMan                             {Disable-WSManCertVerification, Enable-WSManCertV…
OS / ENVIRONMENT
PS /home/cwilliams.local>$host.version

Major  Minor  Build  Revision
-----  -----  -----  --------
7      2      7      -1

Fedora 35 6.0.5-100.fc35.x86_64

*Yes I know MS only 'officially' support Ubuntu but this has always worked.

jborean93 commented 2 years ago

I'm not sure what the culprit would be here, the omi library just sends the data as given to it by PowerShell. If that's causing invalid selectors then something else is at play here. It could totally be something wrong with omi but it's presently quite impossible to really debug and work with so there's little I can do.

uc-cjdavis commented 1 year ago

If it helps, I'm also seeing the same issue on a different platform, MacOS Monterey (12.6.3) with the same command: Connect-IPPSSession

Version              Name                                Repository           Description
-------              ----                                ----------           -----------
2.3.1                PSWSMan                             PSGallery            Module to install and manage the forked WSMan client libraries for Linux and macOS.…
PS /Users/cjdavis> $host.version

Major  Minor  Build  Revision
-----  -----  -----  --------
7      3      1      -1

Here's the verbose output when running the command

PS /Users/xxxx> Connect-IPPSSession -UserPrincipalName "xxxxxx@xxxxx.onmicrosoft.com" -Debug -Verbose
VERBOSE: Returning precomputed version info: 3.0.0
VERBOSE: ModuleVersion: 3.0.0
VERBOSE: [ThreadID: #] Trying to get a new token from AAD
VERBOSE: [ThreadID: #] Trying to acquire token silently as UPN is given
VERBOSE: [ThreadID: #] Successfully able to force refresh a token in user based flow either because token is expired or claims is passed silently.
VERBOSE: [ThreadID: #] Successfully got a token from AAD
VERBOSE: Importing cmdlet 'Add-EXOClientTelemetryWrapper'.
VERBOSE: Importing cmdlet 'New-CmdletLogger'.
VERBOSE: Importing cmdlet 'New-EXOClientTelemetryFilepath'.
VERBOSE: Importing cmdlet 'Push-EXOTelemetryRecord'.
VERBOSE: Importing cmdlet 'Clear-ActiveToken'.
VERBOSE: Importing cmdlet 'Get-ConnectionContext'.
VERBOSE: Importing cmdlet 'Get-ConnectionInformation'.
VERBOSE: Importing cmdlet 'Get-EXOBanner'.
VERBOSE: Importing cmdlet 'Get-HelpFiles'.
VERBOSE: Importing cmdlet 'New-EXOModule'.
VERBOSE: Importing cmdlet 'New-ExoPSSession'.
VERBOSE: Importing cmdlet 'Test-ActiveToken'.
VERBOSE: ConnectionContext Removed
ResourceUnavailable: Processing data for a remote command failed with the following error message: ERROR_WSMAN_INVALID_SELECTORS: The WS-Management service cannot process the request because the request contained invalid selectors for the resource.  For more information,
see the about_Remote_Troubleshooting Help topic
uc-cjdavis commented 1 year ago

@jborean93 Did some further digging and found this issue in the powershell core repo: https://github.com/PowerShell/PowerShell/issues/3771

The above thread points to this issue in the microsoft/omi repo: https://github.com/microsoft/omi/issues/523 It appears to be a problem with load balancing (on the o365 side) and handling of session cookies.

I can enable libmi logging and post results if you think it'd help.