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

Issue happening on ReverseDSC module #3610

Closed
Ngims opened this issue Aug 25, 2023 · 1 comment · Fixed by #3616 or #3624
Closed

Issue happening on ReverseDSC module #3610

Ngims opened this issue Aug 25, 2023 · 1 comment · Fixed by #3616 or #3624

Comments

@Ngims
Copy link

Ngims commented Aug 25, 2023

Description of the issue

I did an export of the following source components

Export-M365DSCConfiguration -Components @("AADAdministrativeUnit", "AADGroupsSettings", "SPOAccessControlSettings", "SPOApp", "SPOBrowserIdleSignout", "SPOSharingSettings") -Credential $SourceCredential

Exporting the config of tenant using the following command: .\M365TenantConfig.ps1 -Credential $Credential errors out

Microsoft 365 DSC Version

1.23.809.1

Which workloads are affected

Azure Active Directory, SharePoint Online

The DSC configuration

M365TenantConfig.zip

Verbose logs showing the problem

PS C:\M365DSC> .\M365TenantConfig.ps1 -Credential $Credential
At C:\M365DSC\M365TenantConfig.ps1:115 char:63

  •         SharingDomainRestrictionMode               = "None";
    
  •                                                           ~~
    

The string is missing the terminator: ".
At C:\M365DSC\M365TenantConfig.ps1:62 char:28

  •     AADGroupsSettings "AADGroupsSettings"
    
  •                        ~~~~~~~~~~~~~~~~~~
    

Unexpected token 'AADGroupsSettings"
{
AllowGuestsToAccessGroups = $True;
AllowGuestsToBeGroupOwner = $False;
AllowToAddGuests = $True;
Credential = $Credscredential;
EnableGroupCreation = $False;
Ensure = "Present";
GuestUsageGuidelinesUrl = "";
IsSingleInstance = "Yes";
UsageGuidelinesUrl = "";
}
SPOAccessControlSettings "SPOAccessControlSettings"
{
CommentsOnSitePagesDisabled = $True;
Credential = $Credscredential;
DisallowInfectedFileDownload = $False;
DisplayStartASiteOption = $False;
EmailAttestationReAuthDays = 30;
EmailAttestationRequired = $False;
Ensure = "Present";
ExternalServicesEnabled = $True;
IPAddressAllowList = "";
IPAddressEnforcement = $False;
IPAddressWACTokenLifetime = 15;
IsSingleInstance = "Yes";
SocialBarOnSitePagesDisabled = $False;
}
SPOBrowserIdleSignout "SPOBrowserIdleSignout"
{
Credential = $Credscredential;
Enabled = $True;
IsSingleInstance = "Yes";
SignOutAfter = "1.00:00:00";
WarnAfter = "23:30:00";
}
SPOSharingSettings "SPOSharingSettings"
{
BccExternalSharingInvitations = $False;
Credential = $Credscredential;
DefaultLinkPermission = "View";
DefaultSharingLinkType = "AnonymousAccess";
EnableGuestSignInAcceleration = $False;
Ensure = "Present";
FileAnonymousLinkType = "Edit";
FolderAnonymousLinkType = "Edit";
IsSingleInstance = "Yes";
MySiteSharingCapability = "ExternalUserAndGuestSharing";
NotifyOwnersWhenItemsReshared = $True;
PreventExternalUsersFromResharing = $False;
ProvisionSharedWithEveryoneFolder = $False;
RequireAcceptingAccountMatchInvitedAccount = $True;
SharingCapability = "ExternalUserAndGuestSharing";
SharingDomainRestrictionMode = "None";
ShowAllUsersClaim = $False;
ShowEveryoneClaim = $False;
ShowEveryoneExceptExternalUsersClaim = $True;
ShowPeoplePickerSuggestionsForGuestUsers = $False;
}
}
}
M365TenantConfig -ConfigurationData .\ConfigurationData.psd1 -Credential $Credential
' in expression or statement.
At C:\M365DSC\M365TenantConfig.ps1:125 char:2
+
Missing closing ')' in subexpression.
At C:\M365DSC\M365TenantConfig.ps1:125 char:1
+
There is an incomplete property assignment block in the instance definition.
At C:\M365DSC\M365TenantConfig.ps1:33 char:5

  • {
    
  • ~
    

Missing closing '}' in statement block or type definition.
At C:\M365DSC\M365TenantConfig.ps1:10 char:1

  • {
  • ~
    Missing closing '}' in statement block or type definition.
    • CategoryInfo : ParserError: (:) [], ParseException
    • FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

Environment Information + PowerShell Version

OsName               : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Name                           Value
----                           -----
PSVersion                      5.1.17763.1971
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.1971
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@ricmestre
Copy link
Contributor

ricmestre commented Aug 25, 2023

@NikCharlebois Hi, the property ScopedRoleMembers, inside resource AADAdministrativeUnit, is not being setup properly because of Convert-DSCStringParamToVariable from ReverseDSC.

Which regex should be added there to solve this particular issue? Something like the below or should the code above this chunk cope with this automatically?

$DSCBlock = $DSCBlock -replace "`"\);$" , ");"

NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Aug 28, 2023
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

Successfully merging a pull request may close this issue.

2 participants