diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a393c8fd..20df85f70d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change log for Microsoft365DSC +## 1.20.1021.1 + +* AADTenantDetails + * Fixed issue where IsSingleInstance was not returned from + the Get-TargetResource method; +* MISC + * Fix to how Telemetry is retrieving module version; + * Added additional error troubleshooting information + to telemetry (dependencies version). + ## 1.20.1016.1 * Fixed a permissions issue with the diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADTenantDetails/MSFT_AADTenantDetails.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADTenantDetails/MSFT_AADTenantDetails.psm1 index f40113e3b9..77e5f14e6c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADTenantDetails/MSFT_AADTenantDetails.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADTenantDetails/MSFT_AADTenantDetails.psm1 @@ -72,10 +72,15 @@ function Get-TargetResource { Write-Verbose -Message "Found existing AzureAD Tenant Details" $result = @{ - MarketingNotificationEmails = $AADTenantDetails.MarketingNotificationEmails - SecurityComplianceNotificationMails = $AADTenantDetails.SecurityComplianceNotificationMails - SecurityComplianceNotificationPhones = $AADTenantDetails.SecurityComplianceNotificationPhones - TechnicalNotificationMails = $AADTenantDetails.TechnicalNotificationMails + IsSingleInstance = 'Yes' + MarketingNotificationEmails = $AADTenantDetails.MarketingNotificationEmails + SecurityComplianceNotificationMails = $AADTenantDetails.SecurityComplianceNotificationMails + SecurityComplianceNotificationPhones = $AADTenantDetails.SecurityComplianceNotificationPhones + TechnicalNotificationMails = $AADTenantDetails.TechnicalNotificationMails + GlobalAdminAccount = $GlobalAdminAccount + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DSCHashTabletoString -Hashtable $result)" return $result diff --git a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 index f6d04b2dec..3b14a1b21c 100644 --- a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 +++ b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 2020-10-16 +# Generated on: 2020-10-21 @{ @@ -11,7 +11,7 @@ # RootModule = '' # Version number of this module. - ModuleVersion = '1.20.1016.1' + ModuleVersion = '1.20.1021.1' # Supported PSEditions # CompatiblePSEditions = @() @@ -174,8 +174,13 @@ IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true' # ReleaseNotes of this module - ReleaseNotes = "* TeamsVoiceRoute - * Initial Release" + ReleaseNotes = "* AADTenantDetails + * Fixed issue where IsSingleInstance was not returned from + the Get-TargetResource method; + * MISC + * Fix to how Telemetry is retrieving module version; + * Added additional error troubleshooting information + to telemetry (dependencies version)." # Flag to indicate whether the module requires explicit user acceptance for install/update # RequireLicenseAcceptance = $false diff --git a/Modules/Microsoft365DSC/Modules/M365DSCLogEngine.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCLogEngine.psm1 index ae21b3bb2b..80907a3eb7 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCLogEngine.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCLogEngine.psm1 @@ -17,7 +17,11 @@ function New-M365DSCLogEntry [Parameter()] [System.String] - $Source + $Source, + + [Parameter()] + [System.String] + $TenantId ) try @@ -33,6 +37,11 @@ function New-M365DSCLogEntry $driftedData.Add("CustomMessage", $Message) $driftedData.Add("Source", $Source) $driftedData.Add("StackTrace", $Error.ScriptStackTrace) + + if ($null -ne $TenantId) + { + $driftedData.Add("TenantId", $TenantId) + } Add-M365DSCTelemetryEvent -Type "Error" -Data $driftedData #endregion diff --git a/Modules/Microsoft365DSC/Modules/M365DSCReverseGUI.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCReverseGUI.psm1 index 6266599757..ac36737e93 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCReverseGUI.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCReverseGUI.psm1 @@ -799,7 +799,26 @@ function Show-M365DSCGUI catch { $Message = "Could not initiate the ReverseDSC Extraction" - New-M365DSCLogEntry -Error $_ -Message $Message -Source "[M365DSCReverseGUI]" + $tenantId = $null + try + { + if (-not [System.String]::IsNullOrEmpty($txtTenantId.Text)) + { + $tenantId = $txtTenantId.Text + } + elseif ($null -ne $GlobalAdminAccount) + { + $tenantId = $GlobalAdminAccount.UserName.Split('@')[1] + } + } + catch + { + Write-Verbose -Message $_ + } + New-M365DSCLogEntry -Error $_ ` + -Message $Message ` + -Source "[M365DSCReverseGUI]" ` + -TenantId $tenantId } }) $panelMenu.Controls.Add($btnExtract); diff --git a/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 index cf044ac6ae..a011f93299 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 @@ -117,8 +117,27 @@ function Add-M365DSCTelemetryEvent } } - $version = (Get-Module 'Microsoft365DSC').Version - $Data.Add("M365DSCVersion", $version) + [array]$version = (Get-Module 'Microsoft365DSC').Version | Sort-Object -Descending + $Data.Add("M365DSCVersion", $version[0].ToString()) + + # Get Dependencies loaded versions + try + { + $currentPath = Join-Path -Path $PSScriptRoot -ChildPath '..\' -Resolve + $manifest = Import-PowerShellDataFile "$currentPath/Microsoft365DSC.psd1" + $dependencies = $manifest.RequiredModules + + $dependenciesContent = "" + foreach($dependency in $dependencies) + { + $dependenciesContent += Get-Module $dependency.ModuleName | Out-String + } + $Data.Add("DependenciesVersion", $dependenciesContent) + } + catch + { + Write-Verbose -Message $_ + } $TelemetryClient.TrackEvent($Type, $Data, $Metrics) $TelemetryClient.Flush()