Hello @RoBiNLolo ,
Thank you for reaching out to Microsoft QnA Platform. I tried to execute command and found this command is working without any issues.
The error message you’re seeing typically occurs when the PowerShell environment does not recognize the
Get-MgBetaDirectorySetting cmdlet. This could be due to a few reasons:
Microsoft.Graph.Beta module may not have been installed correctly. You can verify this by running
Get-Module -ListAvailable Microsoft.Graph.Beta in your PowerShell session. If the module is not listed, you may need to reinstall it.
Microsoft.Graph.Beta module may not have been imported into your PowerShell session. You can do this by running
There could be a conflict with another module that has a cmdlet of the same name. Try using the fully qualified cmdlet name:
- Your PowerShell Execution Policy might be restricting the execution of the script. You can check your execution policy settings by running
Get-ExecutionPolicy. If it’s set to Restricted, you might need to change it to RemoteSigned or Unrestricted using the
If you’ve checked all of these and you’re still experiencing the issue, it might be worth reaching out to Microsoft Support for further assistance. Please remember to replace any sensitive information in your scripts or error messages before sharing them.