Skip to content
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]: Inability to initiate an audit #101

Open
VolcanicHammer opened this issue May 13, 2024 · 2 comments
Open

[Bug]: Inability to initiate an audit #101

VolcanicHammer opened this issue May 13, 2024 · 2 comments
Labels
not a bug Not a bug

Comments

@VolcanicHammer
Copy link

VolcanicHammer commented May 13, 2024

What happened?
Hello !
I am unable to launch an audit.
Here are the steps I followed (Test with 2 different versions of PowerShell)

How to reproduce it
Steps to reproduce the behavior:
With

$PsVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.4291
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4291
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

or

$PsVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0


PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main> pwd
Path
----
C:\Users\XXX\Downloads\monkey365-main\monkey365-main


Command:
PS C:\Users\XXX\Downloads\monkey365-main> Get-ChildItem -Recurse .\monkey365-main\ | Unblock-File
PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main> Import-Module .\Invoke-Monkey365.ps1
PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main> $param = @{
>> Instance = 'Microsoft365';
>>     Analysis = 'ExchangeOnline','Microsoft365','MicrosoftTeams','Purview','SharePointOnline';
>>     PromptBehavior = 'SelectAccount';
>>     TenantID = 'MY-Tenant-ID';
>>     ExportTo = 'HTML';
>> }
PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main> $param = Invoke-Monkey365 @param

New-Object: C:\Users\XXX\Downloads\monkey365-main\monkey365-main\Invoke-Monkey365.ps1:329
Line |
 329 |  … attr_name = New-Object System.Management.Automation.ValidateSetAttrib …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | A constructor was not found. Cannot find an appropriate constructor for type System.Management.Automation.ValidateSetAttribute.
New-O365Object: C:\Users\XXX\Downloads\monkey365-main\monkey365-main\Invoke-Monkey365.ps1:414
Line |
 414 |          New-O365Object
     |          ~~~~~~~~~~~~~~
     | The term 'New-O365Object' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or
     | if a path was included, verify that the path is correct and try again.
Write-Information: C:\Users\XXX\Downloads\monkey365-main\monkey365-main\Invoke-Monkey365.ps1:423
Line |
 423 |          Write-Information @msg
     |                            ~~~~
     | Cannot bind parameter 'InformationAction' to the target. Exception setting "InformationAction": "Cannot convert null to type
     | "System.Management.Automation.ActionPreference" due to enumeration values that are not valid. Specify one of the following enumeration values and try
     | again. The possible enumeration values are "SilentlyContinue;Stop;Continue;Inquire;Ignore;Suspend;Break"."
Import-Module: C:\Users\XXX\Downloads\monkey365-main\monkey365-main\Invoke-Monkey365.ps1:425
Line |
 425 |          Import-Module $MSAL -Scope Global -Force -ArgumentList $O365O|          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The specified module '\core/modules/monkeymsal' was not loaded because no valid module file was found in any module directory.
InvalidOperation: C:\Users\XXX\Downloads\monkey365-main\monkey365-main\Invoke-Monkey365.ps1:430
Line |
 430 |          $O365Object.startDate = $starttimer
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The property 'startDate' cannot be found on this object. Verify that the property exists and can be set.
Update-PsObject: C:\Users\XXX\Downloads\monkey365-main\monkey365-main\Invoke-Monkey365.ps1:431
Line |
 431 |          Update-PsObject
     |          ~~~~~~~~~~~~~~~
     | The term 'Update-PsObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or
     | if a path was included, verify that the path is correct and try again.
Initialize-MonkeyLogger: C:\Users\XXX\Downloads\monkey365-main\monkey365-main\Invoke-Monkey365.ps1:433
Line |
 433 |          Initialize-MonkeyLogger
     |          ~~~~~~~~~~~~~~~~~~~~~~~
     | The term 'Initialize-MonkeyLogger' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the
     | name, or if a path was included, verify that the path is correct and try again.
Initialize-AuthenticationParam: C:\Users\XXX\Downloads\monkey365-main\monkey365-main\Invoke-Monkey365.ps1:440
Line |
 440 |          Initialize-AuthenticationParam
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The term 'Initialize-AuthenticationParam' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling
     | of the name, or if a path was included, verify that the path is correct and try again.
Connect-MonkeyCloud: C:\Users\XXX\Downloads\monkey365-main\monkey365-main\Invoke-Monkey365.ps1:442
Line |
 442 |          Connect-MonkeyCloud
     |          ~~~~~~~~~~~~~~~~~~~
     | The term 'Connect-MonkeyCloud' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name,
     | or if a path was included, verify that the path is correct and try again.
InvalidOperation: C:\Users\XXX\Downloads\monkey365-main\monkey365-main\Invoke-Monkey365.ps1:449
Line |
 449 |          if(($O365Object.onlineServices.GetEnumerator() | Where-Object|             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
Invoke-Monkey365: Cannot bind parameter 'InformationAction' to the target. Exception setting "InformationAction": "Cannot convert null to type "System.Management.Automation.ActionPreference" due to enumeration values that are not valid. Specify one of the following enumeration values and try again. The possible enumeration values are "SilentlyContinue;Stop;Continue;Inquire;Ignore;Suspend;Break"."


Test with this:
PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main> $param = @{
>>     Instance = 'Microsoft365';
>>     Analysis = 'SharePointOnline';
>>     PromptBehavior = 'SelectAccount';
>>     IncludeEntraID = $true;
>>     ExportTo = 'PRINT';
>> }
PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main>     Instance = 'Microsoft365';
Instance: The term 'Instance' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main>     Analysis = 'SharePointOnline';
Analysis: The term 'Analysis' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main>     PromptBehavior = 'SelectAccount';
PromptBehavior: The term 'PromptBehavior' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main>     IncludeEntraID = $true;
IncludeEntraID: The term 'IncludeEntraID' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main>     ExportTo = 'PRINT';
ExportTo: The term 'ExportTo' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\XXX\Downloads\monkey365-main\monkey365-main> }

From where are you running Monkey365?
Please, complete the following information:

  • Resource: workstation)
  • OS: Windows 10
  • PowerShell Version 7.4.2 and 5.1:
  • Monkey365 Version: Latest stable version
@VolcanicHammer VolcanicHammer added bug Something isn't working status/needs-triage Needs triage labels May 13, 2024
@silverhack silverhack added not a bug Not a bug and removed bug Something isn't working status/needs-triage Needs triage labels May 13, 2024
@silverhack
Copy link
Owner

silverhack commented May 13, 2024

Hi @VolcanicHammer

It is not a bug and you're import it incorrectly. You're seeing these errors because the folder does not have the same name as the PSD1. You should rename the folder from Monkey365-main to Monkey365. Once the name is changed you will be able to import the module. And all is explained here.

Please, see docs about how to import a PowerShell module.
https://silverhack.github.io/monkey365/install-instructions/
https://learn.microsoft.com/en-us/powershell/scripting/developer/module/importing-a-powershell-module?view=powershell-7.3

@VolcanicHammer
Copy link
Author

Hi,

It works !
Thank you for your reply :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug Not a bug
Projects
None yet
Development

No branches or pull requests

2 participants