From b8f7df825faa48f0465695dc3525b1b50b71e3d1 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 16 Oct 2020 16:16:26 -0400 Subject: [PATCH 1/8] Update M365DSCTelemetryEngine.psm1 --- Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 index cf044ac6ae..6e4b5e6bca 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 @@ -117,8 +117,8 @@ 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()) $TelemetryClient.TrackEvent($Type, $Data, $Metrics) $TelemetryClient.Flush() From 64ccda0f20e2ce59e8bd1b5ade2d086dd148ea6e Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 16 Oct 2020 16:22:58 -0400 Subject: [PATCH 2/8] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a393c8fd..8f136f019d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change log for Microsoft365DSC +## 1.20.1021.1 + +* MISC + * Fix to how Telemetry is retrieving module version; + ## 1.20.1016.1 * Fixed a permissions issue with the From 4ab15142d6bc223a01d882e298d097a802887df4 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 19 Oct 2020 12:07:21 -0400 Subject: [PATCH 3/8] Fixed issue with AzureAD TenantSettings --- CHANGELOG.md | 3 +++ .../MSFT_AADTenantDetails.psm1 | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f136f019d..67892938e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 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; 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 From 495593bdb4c6b5d8e0fc8f2881f070ede955992d Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 21 Oct 2020 08:56:43 -0400 Subject: [PATCH 4/8] Initial --- .../Modules/M365DSCLogEngine.psm1 | 11 +++++++++- .../Modules/M365DSCReverseGUI.psm1 | 21 ++++++++++++++++++- .../Modules/M365DSCTelemetryEngine.psm1 | 19 +++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) 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..22fd603b32 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 ($null -ne $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..f663acbfb4 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 @@ -120,6 +120,25 @@ function Add-M365DSCTelemetryEvent $version = (Get-Module 'Microsoft365DSC').Version $Data.Add("M365DSCVersion", $version) + # 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() } From 240352a06b71e2e3cef82ce6435004d7cc02adf8 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 21 Oct 2020 09:36:30 -0400 Subject: [PATCH 5/8] Update M365DSCReverseGUI.psm1 --- Modules/Microsoft365DSC/Modules/M365DSCReverseGUI.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Microsoft365DSC/Modules/M365DSCReverseGUI.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCReverseGUI.psm1 index 22fd603b32..ac36737e93 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCReverseGUI.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCReverseGUI.psm1 @@ -802,7 +802,7 @@ function Show-M365DSCGUI $tenantId = $null try { - if ($null -ne $txtTenantId.Text) + if (-not [System.String]::IsNullOrEmpty($txtTenantId.Text)) { $tenantId = $txtTenantId.Text } @@ -817,7 +817,7 @@ function Show-M365DSCGUI } New-M365DSCLogEntry -Error $_ ` -Message $Message ` - -Source "[M365DSCReverseGUI]" + -Source "[M365DSCReverseGUI]" ` -TenantId $tenantId } }) From ae6f60c4d22a25fa918db7a56708c03245d5270a Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 21 Oct 2020 09:37:37 -0400 Subject: [PATCH 6/8] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a393c8fd..f5520436c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change log for Microsoft365DSC +## 1.20.10.21.1 + +* MISC + * Added additional error troubleshooting information + to telemetry (dependencies version). + ## 1.20.1016.1 * Fixed a permissions issue with the From 24d86e29ac38da0c3558714ecf9a722a7e1aae9b Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 21 Oct 2020 09:57:28 -0400 Subject: [PATCH 7/8] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5520436c8..c7226fdb97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change log for Microsoft365DSC -## 1.20.10.21.1 +## 1.20.1021.1 * MISC * Added additional error troubleshooting information From 0be5395dfd0b6c069dbc278307ee8358f67cd6eb Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 21 Oct 2020 14:35:25 -0400 Subject: [PATCH 8/8] Release 1.20.1021.1 --- Modules/Microsoft365DSC/Microsoft365DSC.psd1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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