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

Constantly fails #5774

Open
santiago1976 opened this issue Feb 14, 2025 · 17 comments
Open

Constantly fails #5774

santiago1976 opened this issue Feb 14, 2025 · 17 comments

Comments

@santiago1976
Copy link

Description of the issue

3 hours trying to use this tool....

Installing and reinstalling and updating powershellls and not working. Why you don't publish a simple powershell that works?

Errors with Save-Credentials, Connect-M365Tenant, Sites.Read.All,... If I am the admin role !!!

Microsoft 365 DSC Version

last

Which workloads are affected

SharePoint Online

The DSC configuration

Verbose logs showing the problem

Environment Information + PowerShell Version

@FabienTschanz
Copy link
Collaborator

@santiago1976 How about an error description or any other relevant information that could help pinpoint the issue? Blowing off steam isn't helpful at all.

@santiago1976
Copy link
Author

Image

Unable to retrieve SPO Admin URL: Please check connectivity and if you have the Sites.Read.All permission.

I have global administrator role

@FabienTschanz
Copy link
Collaborator

Thanks for the details. Please execute the following and show us the output of it:

Connect-MgGraph -Scopes Sites.Read.All
Invoke-MgGraphRequest -Uri /v1.0/sites/root

This will connect to Microsoft Graph and fetch the current root site of your Sharepoint address. I assume you have Sharepoint set up? Otherwise it might not return any results. I quickly checked for my account and authentication works with Global Administrator assigned.

@santiago1976
Copy link
Author

Image

This is the site of that url

Image

And I able to access SharePoint admin console because I'm global admin role

Image

@FabienTschanz
Copy link
Collaborator

That's strange. Quick question: Do you provide the username (upn) with the .onmicrosoft.com domain? Try it that way please. It could be that Sharepoint doesn't like it if you specify another domain.

@santiago1976
Copy link
Author

Yes, always use that user: admin@M365x40866878.onmicrosoft.com

@FabienTschanz
Copy link
Collaborator

Did you already try a command that only exports a single resource, e.g. Export-M365DSCConfiguration -Components @("SPOSite") -Path C:\Temp -Credential $cred -Verbose?

@santiago1976
Copy link
Author

Another error: TenantId must be in format contoso.onmicrosoft.com

Image

Image

@FabienTschanz
Copy link
Collaborator

You have to assign $cred first: $cred = Get-Credential. Or replace it by Get-Credential.

$cred = Get-Credential
Export-M365DSCConfiguration -Components @("SPOSite") -Path C:\Temp -Credential $cred -Verbose

@santiago1976
Copy link
Author

Now, it looks like it's working

Image

Image

Image

Image

Image

Image

And if I launch after that Export-M365DSCConfiguration -LaunchWebUI, it looks like it working...

Image

@FabienTschanz
Copy link
Collaborator

Great that it works now. For your information, we will release a version with important bugfixes tomorrow. So please update to the latest version on Thursday to make sure you get them. Exports currently will contain a couple of issues unfortunately. That's probably why you have all those Error Log created at ... messages.

@santiago1976
Copy link
Author

Ok, because I've tried to launch only Exchange, SPOm OneDrive to be "more smaller" and it appears a new error...

Image

@FabienTschanz
Copy link
Collaborator

Can you run Update-M365DSCModule in an elevated Windows PowerShell session please? And also post the output of Get-Command -Name Get-DscResource? It should look like the following:

> Get-Command "Get-DscResource"

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Get-DscResource                                    1.1        PSDesiredStateConfiguration

@santiago1976
Copy link
Author

Image

@FabienTschanz
Copy link
Collaborator

Alright. It seems like that on your machine, the module PSDesiredStateConfiguration in version 1.1 is missing. So the only option to fix this is that you copy the directory C:\Windows\System32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration from another Windows machine (where Get-Command "Get-DscResource" returns something) and place it in that directory on your current machine. If you want to, I can upload a zip version of it from my machine.

Image

@santiago1976
Copy link
Author

But, I don't understand, I have W11, so I understand I'm using the lastest versions of powershell. No?

I'm not sure If you can install powershell 1.0 into W11...

@FabienTschanz
Copy link
Collaborator

You only have to copy the PSDesiredStateConfiguration directory. The v1.0 is simply a default name. You're not downgrading anything nor are you using PowerShell 1 afterwards.

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

2 participants