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

Script completes successfully but does not update config #1914

Closed
yingying96 opened this issue Apr 29, 2022 · 22 comments · Fixed by #2111 or #2123
Closed

Script completes successfully but does not update config #1914

yingying96 opened this issue Apr 29, 2022 · 22 comments · Fixed by #2111 or #2123
Labels
Bug Something isn't working Power Platform

Comments

@yingying96
Copy link

yingying96 commented Apr 29, 2022

I'm trying to run the script locally first but it does not update my config

The script ended successfully but when i export the config again, the values were not changed (from $False to $True) as highlighted below.

image

image

@andikrueger
Copy link
Collaborator

Is this still an issue? Some settings are not changed immediately.

@yingying96
Copy link
Author

I see. Yes. The BlockMacSync is still $False instead of $True.

@malauter
Copy link
Member

malauter commented May 4, 2022

I just tried to reproduce this issue in my lab, but in my case the value of BlockMacSync changes immediately after deploying the configuration.
Could you please check if this still happens after updating M365 DSC, all dependencies and removing outdated dependencies?

Install-Module Microsoft365DSC -Force
Update-M365DSCDependencies
Uninstall-M365DSCOutdatedObjects

@yingying96
Copy link
Author

yingying96 commented May 6, 2022

I couldn't run the uninstall command so i removed them directly in the PS folder.
image

Afterwards i ran build.ps1 then deploy.ps1

Checked the localhost.mof and it is also showing the correct config. But when i run export-m365dsc config command, it will still show it as $False instead of $True.
image

@malauter
Copy link
Member

malauter commented May 9, 2022

The Uninstall-M365DSCOutdatedObjects command does not only remove outdated M365 DSC versions, but it also removes outdated dependencies. Can you repeat the test with only having installed the most current versions of the dependencies and no older dependency versions?

@NikCharlebois
Copy link
Collaborator

@yingying96 is this still an issue after removing the outdated dependencies? Thanks

@yingying96
Copy link
Author

Hi guys, thanks for helping to check. I'm still unable to remove the outdated dependencies. Not sure if i'm missing some other imports?

image

@yingying96
Copy link
Author

Also tried to Get-Module microsoft365dsc | fl but i'm not sure how to see if the uninstall function exist?

image

@malauter
Copy link
Member

@yingying96 The cmdlet is Uninstall-M365DSCOutdatedDependencies, not Uninstall-M365DSCOutdatedObjects. This is a mistake in our documentation, sorry for that.

@andikrueger
Copy link
Collaborator

related PR #1977

@yingying96
Copy link
Author

Thanks! Yes it's still an issue after removing the outdated dependencies.

@andikrueger
Copy link
Collaborator

Could you try to set this value manually and do an export afterwards? We are not able to reproduce this issue at the moment.
See: https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/set-spotenantsyncclientrestriction?view=sharepoint-ps

Could you past the verbose of this cmdlet

Start-DSCConfiguration -wait -verbose -force -Path <PATH TO YOUR FOLDER HOLDING THE MOF FILE>

@yingying96
Copy link
Author

I tried other configs as well. Interestingly it doesn't update even though it shows as completed.

image

@andikrueger
Copy link
Collaborator

Is this happening with any resource within Microsoft 365 DSC? Did you verify the permissions within the tenant? https://microsoft365dsc.com/user-guide/get-started/authentication-and-permissions/

@yingying96
Copy link
Author

Yes i tried about 4-5 resource (OneDrive, SharePoint, Power Platform and etc). I'm trying out with credentials first. The account is a global admin.

@andikrueger
Copy link
Collaborator

Do the applications PnP and Graph have appropriate permissions?

@yingying96
Copy link
Author

image

Would this be sufficient?

@andikrueger
Copy link
Collaborator

This will only list the permissions needed. To get these within M365 you would need to run the following command: https://microsoft365dsc.com/user-guide/cmdlets/Update-M365DSCAllowedGraphScopes/

See example 2.

@yingying96
Copy link
Author

Yup also ran the command to update environment 'global' and received the result "Allowed Graph scopes updated"

@yingying96
Copy link
Author

yingying96 commented Jun 1, 2022

Here's the full script

For M365Configuration.ps1

Configuration ConfigureMicrosoft365
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $credsGlobalAdmin
    )

    Import-DscResource -ModuleName Microsoft365DSC
    
    $password = ConvertTo-SecureString -String "PASSWORD HERE" -AsPlainText -Force
    $username = "[email protected]"
    $cred = New-Object System.Management.Automation.PSCredential($username, $password)

    node localhost
    {
        PPTenantSettings 'PowerPlatformTenantSettings'
        {
            DisableBingVideoSearch                         = $False;
            DisableCapacityAllocationByEnvironmentAdmins   = $False;
            DisableCommunitySearch                         = $False;
            DisableDocsSearch                              = $False;
            DisableEnvironmentCreationByNonAdminUsers      = $True;
            DisableNewsletterSendout                       = $False;
            DisableNPSCommentsReachout                     = $False;
            DisablePortalsCreationByNonAdminUsers          = $False;
            DisableShareWithEveryone                       = $False;
            DisableSupportTicketsVisibleByAllUsers         = $False;
            DisableSurveyFeedback                          = $True;
            DisableTrialEnvironmentCreationByNonAdminUsers = $True;
            EnableGuestsToMake                             = $False;
            IsSingleInstance                               = "Yes";
            ShareWithColleaguesUserLimit                   = 9000;
            WalkMeOptOut                                   = $False;
            Credential                                     = $cred;
        }
    }
}

ConfigureMicrosoft365 -credsGlobalAdmin $cred -ConfigurationData .\M365ConfigurationData.psd1

Start-DscConfiguration -wait -verbose -force -Path D:\Git\Microsoft365Config\ConfigureMicrosoft365

For M365ConfigurationData.psd1

@{
    AllNodes    = @(
        @{
            NodeName                    = 'localhost'
            PSDscAllowPlainTextPassword = $true
            PSDscAllowDomainUser        = $true
        }
    )
}

Results below
image

@yingying96
Copy link
Author

Can i check if the script works for anyone else? Just wondering if my script is wrong or it's a setup issue.

@zeekoo999
Copy link

@yingying96 Have you managed to solve this issue ? i am having the same problem here. WOuld be really helpfull if you could tell me wht you exactly did to get the changes to be affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Power Platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants