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

Add-ConfigurationDataEntry is not recognized as the name of the cmdlet error when running Export-M365DSCConfiguration cmdlet in Microsoft 365DSC module. #5431

Open
risetostar opened this issue Nov 20, 2024 · 7 comments

Comments

@risetostar
Copy link

Description of the issue

We have updated the versions of the following modules.
Install-Module -Name ReverseDSC
Install-Module -Name MSCloudLoginAssistant
Install-Module Microsoft.Graph -Scope CurrentUser
Install-module microsoft.graph, microsoft.graph.beta
Install-Module -Name PSDesiredStateConfiguration -Repository PSGallery -MaximumVersion 2.99
Connect-MgGrap
Connect-MgGraph
Install-module microsoft.graph, microsoft.graph.beta

We have uninstalled and installed every possible ways but unfortunately the error remain same
Exception: The term 'Add-ConfigurationDataEntry' 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.

it would be greatly appreciated if anyone can suggest or assist on this issue.

Microsoft 365 DSC Version

1.24.1113 Microsoft365DSC

Which workloads are affected

Exchange Online

The DSC configuration

Verbose logs showing the problem

Environment Information + PowerShell Version

@FabienTschanz
Copy link
Contributor

@risetostar Did you run Update-M365DSCModule in an elevated Windows PowerShell session? This command installs / updates all the necessary modules to run Microsoft365DSC.

@risetostar
Copy link
Author

@risetostar Did you run Update-M365DSCModule in an elevated Windows PowerShell session? This command installs / updates all the necessary modules to run Microsoft365DSC.

Hi FabienTschanz,
Thank you for reviewing this issue.I have attempted the following troubleshooting steps:

Uninstalled and reinstalled the M365DSCModule.
Ran Update-M365DSCModule in an elevated PowerShell session.
Updated PowerShell 7 to the latest version.
Additionally, I ensured the installation of the following modules:

Install-Module -Name ReverseDSC
Install-Module -Name MSCloudLoginAssistant
Install-Module Microsoft.Graph -Scope CurrentUser
Install-Module -Name PSDesiredStateConfiguration -Repository PSGallery -MaximumVersion 2.99
Despite these steps, I am still encountering the error related to "Add-ConfigurationDataEntry not being recognized as a cmdlet."
Please let me know if you require any further details.

@bsj17
Copy link

bsj17 commented Nov 20, 2024

Testing out m365DSC version 1.24.1113.1. Fresh install. Trying with teams. Same error as @risetostar

export-m365DSCConfiguration -ApplicationId "90d..." -CertificateThumbprint "21..." -TenantId M365x403.onmicrosoft.com -Components @("TeamsAudioConferencingPolicy") -DebuggPolicy") -Debug
Exporting Microsoft 365 configuration for Components: TeamsAudioConferencingPolicy

Authentication methods specified:

  • Service Principal with Certificate Thumbprint

Partial Export file was saved at: C:\Users\bsabadi\AppData\Local\Temp\c319fe96-45a3-4c2b-832e-7c3a2ce85fc5.partial.ps1
Exception: The term 'Add-ConfigurationDataEntry' 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.

@FabienTschanz
Copy link
Contributor

I'll spin up a test machine and check.

@FabienTschanz
Copy link
Contributor

@bsj17 @risetostar I was able to successfully export a configuration using the following lines of code in an elevated Windows PowerShell (not PowerShell 7 / Core):

Install-Module Microsoft365DSC -Force
Set-ExecutionPolicy Bypass
Update-M365DSCModule
# Import certificate - No PowerShell command
Export-M365DSCConfiguration -Components "IntuneFirewallPolicyWindows10" -Path "C:\testbed" -ApplicationId <applicationId> -TenantId abc.onmicrosoft.com -CertificateThumbprint <thumbprint>

And that's it. Fresh from a Windows sandbox environment, no additional things.

Add-ConfigurationDataEntry is part of the ReverseDSC module. Please provide the following output from a Windows PowerShell session: Get-Module ReverseDSC -ListAvailable.

@risetostar Also, Install-Module Microsoft.Graph -Scope CurrentUser is wrong. That doesn't do any good, installing it in the user scope. Please only use either Update-M365DSCModule or Update-M365DSCDependencies to update / install the dependencies on that machine.

@risetostar
Copy link
Author

@bsj17 @risetostar I was able to successfully export a configuration using the following lines of code in an elevated Windows PowerShell (not PowerShell 7 / Core):

Install-Module Microsoft365DSC -Force
Set-ExecutionPolicy Bypass
Update-M365DSCModule

Import certificate - No PowerShell command

Export-M365DSCConfiguration -Components "IntuneFirewallPolicyWindows10" -Path "C:\testbed" -ApplicationId -TenantId abc.onmicrosoft.com -CertificateThumbprint
And that's it. Fresh from a Windows sandbox environment, no additional things.

Add-ConfigurationDataEntry is part of the ReverseDSC module. Please provide the following output from a Windows PowerShell session: Get-Module ReverseDSC -ListAvailable.

@risetostar Also, Install-Module Microsoft.Graph -Scope CurrentUser is wrong. That doesn't do any good, installing it in the user scope. Please only use either Update-M365DSCModule or Update-M365DSCDependencies to update / install the dependencies on that machine.

Dear Fabien Tschanz
Thank you so much for sharing your testing results and the detailed steps. I followed your guidance, and I’m happy to report that I was able to successfully achieve the desired outcome. Your assistance made all the difference!

@FabienTschanz
Copy link
Contributor

@risetostar Glad you got it working. Can you therefore close the issue? Thank you.

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

No branches or pull requests

3 participants