-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Monkey365 causes exception when SharePoint url is not detected #107
Comments
Hey @olivierdumon, thanks for submitting this! Seems that monkey365 is unable to get information from Microsoft Graph regarding available domains for SharePoint. As a workaround, could you please include the -ScanSites param? Invoke-Monkey365 -Instance Microsoft365 -Analysis SharePointOnline `
-ScanSites https://**yourdomain**.sharepoint.com `
-DeviceCode -Verbose -Debug `
-InformationAction Continue -Compress Additionaly, and due that your main OS is Windows and PowerShell core, you can also force monkey365 to load MSAL libraries for Windows desktop and omit the DeviceCode, as shown below: Invoke-Monkey365 -Instance Microsoft365 -Analysis SharePointOnline `
-ScanSites https://**yourdomain**.sharepoint.com `
-Verbose -Debug `
-InformationAction Continue -Compress -ForceMSALDesktop Could you please try and do let me know? |
Hi @silverhack Any idea on what's causing this behaviour ? Good day |
And for information here is the result of the command with the '-ForceMSALDesktop' parameter. CONSOLE: [13:25:08:254] - [New-Logger] - Initializing loggers - info - XXXXXX - MonkeyLog
|
Hey @olivierdumon, This happens because you have tried to reload net libraries within the same session. You can see that in logs: Write-Error: [13:25:08:794] - [Install-MsalLibrary] - Assembly with same name is already loaded. LineNumber: At C:\temp\monkey365\core\modules\monkeymsal\monkeymsal.psm1:81 char:9 + Add-Type @params | Out-Null + This is by design in PowerShell, so the solution would be to start a new PowerShell session |
An regarding domains, I believe that SharePoint domain is not tied to the root tenant. Monkey365 will try to find the SharePoint root url by appending the sharepoint.com dns suffix to the tenant name. |
OK, I note your answers. Good day |
My pleasure. You too |
Hi, Closing this as already implemented in main branch. Thanks for using Monkey365! |
What happened?
Error message when attempting a sharepoint online message
How to reproduce it
What command are you running?
Invoke-Monkey365 -Instance Microsoft365 -Analysis ExchangeOnline -ExportTo HTML -Compress
or
Invoke-Monkey365 -Instance Microsoft365 -Analysis ExchangeOnline -ExportTo HTML -Compress -DeviceCode:$true
See error
Connect-MonkeySPO: C:\temp\monkey365\core\api\auth\microsoft365\Connect-MonkeyM365.ps1:182
Line |
182 | … 365Object.auth_tokens.SharePointOnline = Connect-MonkeySPO @p -RootSi …
| ~~
| Cannot bind argument to parameter 'Endpoint' because it is an empty string.
Connect-MonkeySPO: C:\temp\monkey365\core\api\auth\microsoft365\Connect-MonkeyM365.ps1:184
Line |
184 | … bject.auth_tokens.SharePointAdminOnline = Connect-MonkeySPO @p -Admin
| ~~
| Cannot bind argument to parameter 'Endpoint' because it is an empty string.
Connect-MonkeySPO: C:\temp\monkey365\core\api\auth\microsoft365\Connect-MonkeyM365.ps1:186
Line |
186 | … $O365Object.auth_tokens.OneDrive = Connect-MonkeySPO @p -OneDri …
| ~~
| Cannot bind argument to parameter 'Endpoint' because it is an empty string.
Expected behavior
Normal report creation as with other modules
Screenshots or Logs
VERBOSE: Loading module from path 'C:\temp\monkey365\core\modules\monkeymsal\monkeymsal.psd1'.
VERBOSE: Removing the imported "New-MonkeyMSALApplicationClientOptions" function.
VERBOSE: Removing the imported "New-MonkeyMsalApplication" function.
VERBOSE: Removing the imported "Get-MonkeyMSALToken" function.
VERBOSE: Removing the imported "Convert-SecureStringToPlainText" function.
VERBOSE: Loading module from path 'C:\temp\monkey365\core\modules\monkeymsal\monkeymsal.psm1'.
VERBOSE: [09:15:48:294] - [monkeymsal.psm1] - Windows OS detected. Loading MSAL Core - verbose - xxxxxx -
VERBOSE: Exporting function 'Get-CoreLib'.
VERBOSE: Exporting function 'Get-DeskLibForCore'.
VERBOSE: Exporting function 'Get-DesktopLib'.
VERBOSE: Exporting function 'Install-MsalLibrary'.
VERBOSE: Exporting function 'Convert-SecureStringToPlainText'.
VERBOSE: Exporting function 'Get-LocalizedData'.
VERBOSE: Exporting function 'Get-OsInfo'.
VERBOSE: Exporting function 'New-MonkeyMSALApplicationClientOptions'.
VERBOSE: Exporting function 'Get-MonkeyMSALToken'.
VERBOSE: Exporting function 'New-MonkeyMsalApplication'.
VERBOSE: Importing function 'Convert-SecureStringToPlainText'.
VERBOSE: Importing function 'Get-MonkeyMSALToken'.
VERBOSE: Importing function 'New-MonkeyMsalApplication'.
VERBOSE: Importing function 'New-MonkeyMSALApplicationClientOptions'.
VERBOSE: [09:15:55:846] - [Get-MonkeyMSGraphObject] - Getting organization from microsoft graph - verbose - xxxxxxx -
VERBOSE: [09:15:59:249] - [Get-TenantInformation] - Getting tenant information from xxxxxxxxxxxxxx Id - verbose - xxxxxx - AADTenantInfo
VERBOSE: [09:15:59:940] - [Get-MonkeyMSGraphObject] - Getting organization from microsoft graph - verbose - xxxxxx -
VERBOSE: [09:16:00:666] - [Get-MonkeyMSGraphObject] - Getting subscribedSkus from microsoft graph - verbose - xxxxxx -
VERBOSE: [09:16:01:241] - [Get-MonkeyMSGraphObject] - Getting domains from microsoft graph - verbose - xxxxxx -
Connect-MonkeySPO: C:\temp\monkey365\core\api\auth\microsoft365\Connect-MonkeyM365.ps1:182
Line |
182 | … 365Object.auth_tokens.SharePointOnline = Connect-MonkeySPO @p -RootSi …
| ~~
| Cannot bind argument to parameter 'Endpoint' because it is an empty string.
Connect-MonkeySPO: C:\temp\monkey365\core\api\auth\microsoft365\Connect-MonkeyM365.ps1:184
Line |
184 | … bject.auth_tokens.SharePointAdminOnline = Connect-MonkeySPO @p -Admin
| ~~
| Cannot bind argument to parameter 'Endpoint' because it is an empty string.
Connect-MonkeySPO: C:\temp\monkey365\core\api\auth\microsoft365\Connect-MonkeyM365.ps1:186
Line |
186 | … $O365Object.auth_tokens.OneDrive = Connect-MonkeySPO @p -OneDri …
| ~~
| Cannot bind argument to parameter 'Endpoint' because it is an empty string.
VERBOSE: [09:16:01:747] - [Get-MonkeyMSGraphUserDirectoryRole] - Getting user's information from xxxxxx - verbose - xxxxxx - AzureGraphDirectoryRoleByUserId
VERBOSE: [09:16:02:317] - [Get-MonkeyMSGraphObject] - Getting users/xxxxxx/transitiveMemberOf from microsoft graph - verbose - xxxxxx -
VERBOSE: [09:16:02:893] - [Get-MonkeyMSGraphObject] - Getting users from microsoft graph - verbose - xxxxxx -
VERBOSE: [09:16:03:647] - [Get-MonkeyMSGraphObject] - Getting groups from microsoft graph - verbose - xxxxxx -
VERBOSE: [09:16:04:216] - [Get-MonkeyMSGraphObject] - Getting me from microsoft graph - verbose - xxxxxx -
VERBOSE: [09:16:04:773] - [Stop-Logger] - Stopping logger - verbose - xxxxxx -
From where are you running Monkey365?
Please, complete the following information:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: