Comments (8)
Do you see the PnP. PowerShell module when you run this command?
Get-Module -ListAvailable | Where-Object {$_.Name -eq 'PnP.PowerShell'}
from 365inspect.
No it comes back blank. Even though I have installed it (several times)
from 365inspect.
Installed again and now shows
ModuleType Version PreRelease Name PSEdition ExportedCommands
Manifest 2.2.0 PnP.PowerShell
but still getting this
Connecting to Exchange Online
Connecting to SharePoint Service
Connecting to SharePoint Service Failed.
Write-Error: C:\365inspect\365Inspect-main\365Inspect.ps1:387
Line |
387 | Connect-Services
| ~~~~~~~~~~~~~~~~
| Could not load file or assembly 'Microsoft.Identity.Client, Version=4.50.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae'. Could not find or load a specific file. (0x80131621)
from 365inspect.
I am able to replicate that issue. We will work on a fix.
We can confirm that using PowerShell 5.1 (Windows PowerShell) and PnP.PowerShell version 1.12.0 works as expected.
We do also see several open and unresolved issues where this error is thrown in PowerShell 7+ using the PnP.PowerShell version 2+
from 365inspect.
We were able to resolve this issue.
The resolution was to forcefully remove the existing PnP.PowerShell module (in our case, this meant opening Explorer and navigating to C:\Users\User\Documents\PowerShell\Module\PnP.PowerShell
and deleting the folder named 2.x).
You will need to close all instances of pwsh.exe - any open windows, VS Code if it is open, etc.
Once the module has been purged, reinstalling the module with the CurrentUser Scope allowed us to progress past the authentication screen without errors and run the assessment tool.
Install-Module -Name PnP.PowerShell -Scope CurrentUser -Force
from 365inspect.
Unfortunately still no joy. I'm getting a different error now regarding MS Identity client, which I have also freshly installed in current user scope
Environment is 7.4.0
[+] PowerShellGet is installed.
Importing PowerShellGet
Environment is 7.4.0
[+] ExchangeOnlineManagement is installed.
Inporting ExchangeOnlineManagement
Importing Microsoft.Graph
Environment is 7.4.0
[+] Microsoft.Graph is installed.
Inporting ExchangeOnlineManagement
Importing Microsoft.Graph
Get-Package: No match was found for the specified search criteria and module names 'PnP.PowerShell'.
InvalidArgument: C:\365inspect\365Inspect-main\365Inspect.ps1:269
Line |
269 | $installedVersion = [Version](((Get-InstalledModule -Name $mo …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert value "" to type "System.Version". Error: "Version string portion was too short or too long.
| (Parameter 'input')"
Environment is 7.4.0
[+] PnP.PowerShell is installed.
Environment is 7.4.0
[+] MicrosoftTeams is installed.
Importing MicrosoftTeams
Connecting to Microsoft Graph
Welcome to Microsoft Graph!
Connected via delegated access using 14d82eec-204b-4c2f-b7e8-296a70dab67e
Readme: https://aka.ms/graph/sdk/powershell
SDK Docs: https://aka.ms/graph/sdk/powershell/docs
API Docs: https://aka.ms/graph/docs
NOTE: You can use the -NoWelcome parameter to suppress this message.
Connected via Graph to xxxxxxxxxxxxxxx
Connecting to Security and Compliance Center
We have made updates to move the SCC admin experience to REST-based APIs. In doing so, we will be deprecating the legacy Remote PowerShell (RPS) protocol starting July 15, 2023.
Benefits of REST-based cmdlets: improved security, WinRM no longer required for client-server communication, improved error handling.
The REST API has the same cmdlets available and feature parity with RPS(V1) cmdlets, so existing scripts and processes don't need to be updated. Simply using the new module will ensure REST is used rather than RPS.
For more information, go to https://aka.ms/exov3-module
Connecting to Exchange Online
Connecting to SharePoint Service
Connecting to SharePoint Service Failed.
Write-Error: C:\365inspect\365Inspect-main\365Inspect.ps1:387
Line |
387 | Connect-Services
| ~~~~~~~~~~~~~~~~
| Could not load file or assembly 'Microsoft.Identity.Client, Version=4.50.0.0, Culture=neutral,
| PublicKeyToken=0a613f4dd989e8ae'. Could not find or load a specific file. (0x80131621)
from 365inspect.
Have removed everything and gone back to 5.1 and all good now
from 365inspect.
We've run into this issue with the MS Identity Client many times. It appears to be related to the various modules dependencies and packaged versions of the client. In some cases a newer version of a module has fixed it, in others we've needed to revert to the last known working versions of several modules.
If it helps, this is the current versioning running on my machine and everything works as expected with the fix listed above.
We do still caution using the tool with PS Core as some functionality will be limited in specific PowerShell modules, but we strive to support it regardless.
Thank you for using our tool, we hope it provides you with some valuable insight!
Please do not hesitate to reach back out with any additional issues, questions, or feature requests.
from 365inspect.
Related Issues (20)
- Could not connect to SharePoint Online HOT 2
- Bug running script on PowerShell 7.3.4 HOT 3
- Script does not work in pwsh 7.3.4 HOT 7
- Sharepoint Module may not connect if Exchange Hybrid is present
- Inspect-AZPSAssignment and Inspect-AZPSModules: Microsoft Graph PowerShell renamed to Microsoft Graph Command Line Tools
- Module Loading Errors HOT 6
- Report HTML contains broken links to txt-files HOT 1
- Parameter incorrectly set
- When excuting The term 'Select-MgProfile' is not recognized HOT 13
- Excessive Privilege -> Not Using Microsoft Graph HOT 2
- Inspector - AdminUsersWithNoMFAEnforced.ps1 - Returns Error HOT 6
- Using Oauth access token to run script on behalf of client HOT 1
- Does this work in M365 GCC High? HOT 4
- Connecting to Exchange Online Failed
- Output Report.html: no work in oder device HOT 6
- Error executing main script HOT 6
- bug due to exchange online update
- Microsoft 365 Assessment can't export the data HOT 1
- Compatibility Issues between Powershell Modules HOT 1
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 365inspect.