This commit is contained in:
Mikael Karlsson
2024-06-27 21:00:44 +10:00
parent b7e04bc820
commit 5326bd5525
297 changed files with 2546 additions and 822 deletions

View File

@@ -11,7 +11,7 @@ Objects can be compared based on Properties or Documentatation info.
function Get-ModuleVersion
{
'1.0.11'
'1.1.0'
}
function Invoke-InitializeModule
@@ -50,7 +50,7 @@ function Add-CompareProvider
if($global:compareProviders.Count -eq 0)
{
$global:compareProviders += [PSCustomObject]@{
Name = "Intune Objects with Exported Files"
Name = "Exported Files with Intune Objects (Id)"
Value = "export"
ObjectCompare = { Compare-ObjectsBasedonProperty @args }
BulkCompare = { Start-BulkCompareExportObjects @args }
@@ -58,6 +58,15 @@ function Add-CompareProvider
Activate = { Invoke-ActivateCompareWithExportObjects @args }
}
$global:compareProviders += [PSCustomObject]@{
Name = "Intune Objects with Exported Files (Name)"
Value = "IntuneWithExport"
ObjectCompare = { Compare-ObjectsBasedonProperty @args }
BulkCompare = { Start-BulkCompareExportIntuneToNamedExportedObjects @args }
ProviderOptions = "CompareExportOptions"
Activate = { Invoke-ActivateCompareWithExportObjects @args }
}
$global:compareProviders += [PSCustomObject]@{
Name = "Named Objects in Intune"
Value = "name"
@@ -163,7 +172,7 @@ function Show-CompareBulkForm
$script:cmpForm = Get-XamlObject ($global:AppRootFolder + "\Xaml\BulkCompare.xaml") -AddVariables
if(-not $script:cmpForm) { return }
$global:cbCompareProvider.ItemsSource = @(($global:compareProviders | Where BulkCompare -ne $null))
$global:cbCompareProvider.ItemsSource = @($global:compareProviders)
$global:cbCompareProvider.SelectedValue = (Get-Setting "Compare" "Provider" "export")
$global:cbCompareSave.ItemsSource = @($script:saveType)
@@ -175,6 +184,11 @@ function Show-CompareBulkForm
$global:cbCompareCSVDelimiter.ItemsSource = @("", ",",";","-","|")
$global:cbCompareCSVDelimiter.SelectedValue = (Get-Setting "Compare" "Delimiter" ";")
$global:chkSkipCompareBasicProperties.IsChecked = (Get-Setting "Compare" "SkipCompareBasicProperties") -eq "true"
$global:chkSkipCompareAssignments.IsChecked = (Get-Setting "Compare" "SkipCompareAssignments") -eq "true"
$global:chkSkipMissingSourcePolicies.IsChecked = (Get-Setting "Compare" "SkipMissingSourcePolicies") -eq "true"
$global:chkSkipMissingDestinationPolicies.IsChecked = (Get-Setting "Compare" "SkipMissingDestinationPolicies") -eq "true"
$script:compareObjects = @()
foreach($objType in $global:lstMenuItems.ItemsSource)
{
@@ -220,6 +234,12 @@ function Show-CompareBulkForm
Save-Setting "Compare" "Provider" $global:cbCompareProvider.SelectedValue
Save-Setting "Compare" "Type" $global:cbCompareType.SelectedValue
Save-Setting "Compare" "Delimiter" $global:cbCompareCSVDelimiter.SelectedValue
Save-Setting "Compare" "SkipCompareBasicProperties" $global:chkSkipCompareBasicProperties.IsChecked
Save-Setting "Compare" "SkipCompareAssignments" $global:chkSkipCompareAssignments.IsChecked
Save-Setting "Compare" "SkipMissingSourcePolicies" $global:chkSkipMissingSourcePolicies.IsChecked
Save-Setting "Compare" "SkipMissingDestinationPolicies" $global:chkSkipMissingDestinationPolicies.IsChecked
if($global:cbCompareProvider.SelectedItem.BulkCompare)
{
& $global:cbCompareProvider.SelectedItem.BulkCompare
@@ -229,7 +249,27 @@ function Show-CompareBulkForm
$global:cbCompareProvider.Add_SelectionChanged({
Set-CompareProviderOptions $this
})
})
Add-XamlEvent $script:cmpForm "btnExportSettingsForSilentCompare" "add_click" ({
$sf = [System.Windows.Forms.SaveFileDialog]::new()
$sf.FileName = "BulkCompare.json"
$sf.DefaultExt = "*.json"
$sf.Filter = "Json (*.json)|*.json|All files (*.*)|*.*"
if($sf.ShowDialog() -eq "OK")
{
$tmp = [PSCustomObject]@{
Name = "ObjectTypes"
Type = "Custom"
ObjectTypes = @()
}
foreach($ot in ($global:dgObjectsToCompare.ItemsSource | Where Selected -eq $true))
{
$tmp.ObjectTypes += $ot.ObjectType.Id
}
Export-GraphBatchSettings $sf.FileName $script:cmpForm "BulkCompare" @($tmp)
}
})
Set-CompareProviderOptions $global:cbCompareProvider
@@ -266,7 +306,7 @@ function Set-CompareProviderOptions
}
else
{
$global:ccContentProviderOptions.Content = $null
$global:ccContentProviderOptions.Content = $null
}
$global:ccContentProviderOptions.Visibility = (?: ($global:ccContentProviderOptions.Content -eq $null) "Collapsed" "Visible")
@@ -586,13 +626,15 @@ function Start-BulkCompareExportObjects
if(-not $curObject)
{
# Add objects that are exported but deleted
Write-Log "Object '$($objName)' with id $($fileObj.Object.Id) not found in Intune. Deleted?" 2
$compareProperties = @([PSCustomObject]@{
Object1Value = $null
Object2Value = (Get-GraphObjectName $fileObj.Object $item.ObjectType)
Match = $false
})
if($global:chkSkipMissingDestinationPolicies.IsChecked -ne $true) {
# Add objects that are exported but deleted
Write-Log "Object '$($objName)' with id $($fileObj.Object.Id) not found in Intune. Deleted?" 2
$compareProperties = @([PSCustomObject]@{
Object1Value = $null
Object2Value = (Get-GraphObjectName $fileObj.Object $item.ObjectType)
Match = $false
})
}
}
else
{
@@ -610,27 +652,29 @@ function Start-BulkCompareExportObjects
}
}
foreach($graphObj in $graphObjects)
{
# Add objects that are not exported
if(($compareObjectsResult | Where { $_.Id -eq $graphObj.Id})) { continue }
$objName = Get-GraphObjectName $graphObj.Object $item.ObjectType
if($txtNameFilter -and $objName -notmatch [RegEx]::Escape($txtNameFilter))
if($global:chkSkipMissingSourcePolicies.IsChecked -ne $true) {
foreach($graphObj in $graphObjects)
{
continue
}
# Add objects that are in Intune but not exported
if(($compareObjectsResult | Where { $_.Id -eq $graphObj.Id})) { continue }
$compareObjectsResult += [PSCustomObject]@{
Object1 = $curObject.Object
Object2 = $null
ObjectType = $item.ObjectType
Id = $graphObj.Id
Result = @([PSCustomObject]@{
Object1Value = $objName
Object2Value = $null
Match = $false
})
$objName = Get-GraphObjectName $graphObj.Object $item.ObjectType
if($txtNameFilter -and $objName -notmatch [RegEx]::Escape($txtNameFilter))
{
continue
}
$compareObjectsResult += [PSCustomObject]@{
Object1 = $curObject.Object
Object2 = $null
ObjectType = $item.ObjectType
Id = $graphObj.Id
Result = @([PSCustomObject]@{
Object1Value = $objName
Object2Value = $null
Match = $false
})
}
}
}
@@ -685,6 +729,193 @@ function Start-BulkCompareExportObjects
}
}
function Start-BulkCompareExportIntuneToNamedExportedObjects
{
Write-Log "****************************************************************"
Write-Log "Start bulk compare Intune with Exported Objects compare"
Write-Log "****************************************************************"
$compareObjectsResult = @()
$txtNameFilter = (Get-XamlProperty $global:ccContentProviderOptions.Content "txtCompareNameFilter" "Text")
if($txtNameFilter -is [String])
{
$txtNameFilter = $txtNameFilter.Trim()
}
$rootFolder = (Get-XamlProperty $global:ccContentProviderOptions.Content "txtExportPath" "Text")
$compareProps = $script:defaultCompareProps
foreach($removeProp in $global:cbCompareProvider.SelectedItem.RemoveProperties)
{
$compareProps.Remove($removeProp) | Out-Null
}
foreach($removeProp in $global:cbCompareType.SelectedItem.RemoveProperties)
{
$compareProps.Remove($removeProp) | Out-Null
}
if(-not $rootFolder)
{
[System.Windows.MessageBox]::Show("Root folder must be specified", "Error", "OK", "Error")
return
}
if([IO.Directory]::Exists($rootFolder) -eq $false)
{
[System.Windows.MessageBox]::Show("Root folder $rootFolder does not exist", "Error", "OK", "Error")
return
}
$outputType = $global:cbCompareSave.SelectedValue
Save-Setting "Compare" "SaveType" $outputType
$compResultValues = @()
foreach($item in ($global:dgObjectsToCompare.ItemsSource | where Selected -eq $true))
{
Write-Status "Compare $($item.ObjectType.Title) objects" -Force -SkipLog
Write-Log "----------------------------------------------------------------"
Write-Log "Compare $($item.ObjectType.Title) objects"
Write-Log "----------------------------------------------------------------"
$folder = Join-Path $rootFolder $item.ObjectType.Id
if([IO.Directory]::Exists($folder))
{
Save-Setting "" "LastUsedFullPath" $folder
[array]$graphObjects = Get-GraphObjects -property $item.ObjectType.ViewProperties -objectType $item.ObjectType
$fileObjects = @(Get-GraphFileObjects $folder -ObjectType $item.ObjectType)
foreach ($graphObject in @($graphObjects))
{
$objName = Get-GraphObjectName $graphObject.Object $graphObject.ObjectType
if($txtNameFilter -and $objName -notmatch [RegEx]::Escape($txtNameFilter))
{
continue
}
$fileObj = $fileObjects | Where { (Get-GraphObjectName $_.Object $_.ObjectType) -eq $objName }
if(-not $fileObj)
{
# Add objects that are exported but deleted
if($global:chkSkipMissingDestinationPolicies.IsChecked -ne $true) {
Write-Log "Object '$($objName)' with id $($fileObj.Object.Id) not found in exported folder. New Object?" 2
$compareProperties = @([PSCustomObject]@{
Object1Value = $objName
Object2Value = $null
Match = $false
})
}
}
elseif(($fileObj | measure).Count -gt 1)
{
# Add objects that are exported but deleted
Write-Log "Multiple exported objects found with name '$($objName)" 2
$compareProperties = @([PSCustomObject]@{
Object1Value = $objName
Object2Value = $null
Match = $false
})
}
else
{
$sourceObj = Get-GraphObject $graphObject.Object $graphObject.ObjectType
$fileObj.Object | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force
$compareProperties = Compare-Objects $sourceObj.Object $fileObj.Object $item.ObjectType
}
$compareObjectsResult += [PSCustomObject]@{
Object1 = $graphObject.Object
Object2 = $fileObj.Object
ObjectType = $item.ObjectType
Id = $graphObject.Object.Id
Result = $compareProperties
}
}
if($global:chkSkipMissingSourcePolicies.IsChecked -ne $true) {
foreach ($fileObj in @($fileObjects))
{
# Add objects that are exported but not in Intune
if(($compareObjectsResult | Where { $_.FileInfo.FullName -eq $fileObj.FileInfo.FullName})) { continue }
$objName = Get-GraphObjectName $fileObj.Object $item.ObjectType
if($txtNameFilter -and $objName -notmatch [RegEx]::Escape($txtNameFilter))
{
continue
}
$compareObjectsResult += [PSCustomObject]@{
Object1 = $null
Object2 = $fileObj.Object
ObjectType = $item.ObjectType
Id = $fileObj.Object.Id
Result = @([PSCustomObject]@{
Object1Value = $objName
Object2Value = $null
Match = $false
})
}
}
}
if($outputType -eq "objectType")
{
$compResultValues = @()
}
foreach($compObj in @($compareObjectsResult | Where { $_.ObjectType.Id -eq $item.ObjectType.Id }))
{
$objName = Get-GraphObjectName $item.Object $item.ObjectType
foreach($compValue in $compObj.Result)
{
$compResultValues += [PSCustomObject]@{
ObjectName = $objName
Id = $compObj.Id
Type = $compObj.ObjectType.Title
ODataType = $compObj.Object1.'@OData.Type'
Property = $compValue.PropertyName
Value1 = $compValue.Object1Value
Value2 = $compValue.Object2Value
Category = $compValue.Category
SubCategory = $compValue.SubCategory
Match = $compValue.Match
}
}
}
if($outputType -eq "objectType")
{
Save-BulkCompareResults $compResultValues (Join-Path $folder "Compare_$(((Get-Date).ToString("yyyyMMdd-HHmm"))).csv") $compareProps
}
}
else
{
Write-Log "Folder $folder not found. Skipping compare" 2
}
}
if($outputType -eq "all" -and $compResultValues.Count -gt 0)
{
Save-BulkCompareResults $compResultValues (Join-Path $rootFolder "Compare_$(((Get-Date).ToString("yyyyMMDD-HHmm"))).csv") $compareProps
}
Write-Log "****************************************************************"
Write-Log "Bulk compare Intune with Exported Objects finished"
Write-Log "****************************************************************"
Write-Status ""
if($compareObjectsResult.Count -eq 0)
{
[System.Windows.MessageBox]::Show("No objects were comparced. Verify folder and exported files", "Error", "OK", "Error")
}
}
function Start-BulkCompareExportFolders
{
Write-Log "****************************************************************"
@@ -765,13 +996,15 @@ function Start-BulkCompareExportFolders
if(-not $compareObject)
{
# Add objects that are exported but deleted
Write-Log "Object '$($objName)' with id $($fileSourceObj.Object.Id) not found in Intune. Deleted?" 2
$compareProperties = @([PSCustomObject]@{
Object1Value = $null
Object2Value = (Get-GraphObjectName $fileSourceObj.Object $fileSourceObj.ObjectType)
Match = $false
})
if($global:chkSkipMissingDestinationPolicies.IsChecked -ne $true) {
# Add objects that are exported but deleted
Write-Log "Object '$($objName)' with id $($fileSourceObj.Object.Id) not found in Intune. Deleted?" 2
$compareProperties = @([PSCustomObject]@{
Object1Value = $null
Object2Value = (Get-GraphObjectName $fileSourceObj.Object $fileSourceObj.ObjectType)
Match = $false
})
}
}
else
{
@@ -789,27 +1022,29 @@ function Start-BulkCompareExportFolders
}
}
foreach($fileCompareObj in $fileCompareObjs)
{
# Add objects that were not exported in source folder
if(($compareObjectsResult | Where { $_.Id -eq $fileCompareObj.Object.Id})) { continue }
if($global:chkSkipMissingSourcePolicies.IsChecked -ne $true) {
foreach($fileCompareObj in $fileCompareObjs)
{
# Add objects that were not exported in source folder
if(($compareObjectsResult | Where { $_.Id -eq $fileCompareObj.Object.Id})) { continue }
$objName = Get-GraphObjectName $fileCompareObj.Object $item.ObjectType
if($txtNameFilter -and $objName -notmatch [RegEx]::Escape($txtNameFilter))
{
continue
}
$objName = Get-GraphObjectName $fileCompareObj.Object $item.ObjectType
if($txtNameFilter -and $objName -notmatch [RegEx]::Escape($txtNameFilter))
{
continue
}
$compareObjectsResult += [PSCustomObject]@{
Object1 = $fileCompareObj.Object
Object2 = $null
ObjectType = $item.ObjectType
Id = $fileCompareObj.Object.Id
Result = @([PSCustomObject]@{
Object1Value = (Get-GraphObjectName $fileCompareObj.Object $item.ObjectType)
Object2Value = $null
Match = $false
})
$compareObjectsResult += [PSCustomObject]@{
Object1 = $fileCompareObj.Object
Object2 = $null
ObjectType = $item.ObjectType
Id = $fileCompareObj.Object.Id
Result = @([PSCustomObject]@{
Object1Value = (Get-GraphObjectName $fileCompareObj.Object $item.ObjectType)
Object2Value = $null
Match = $false
})
}
}
}
@@ -1147,6 +1382,12 @@ function Compare-ObjectsBasedonProperty
$coreProps = @((?? $objectType.NameProperty "displayName"), "Description", "Id", "createdDateTime", "lastModifiedDateTime", "version")
$postProps = @("Advertisements")
$skipProps = @("@ObjectFromFile")
$skipPropertiesToCompare = @()
if($skipBasicProperties) {
$skipPropertiesToCompare += "roleScopeTagIds"
$skipPropertiesToCompare += "roleScopeTags"
}
foreach ($propName in $coreProps)
{
@@ -1171,7 +1412,7 @@ function Compare-ObjectsBasedonProperty
$addedProps += $propName
$val1 = ($obj1.$propName | ConvertTo-Json -Depth 10)
$val2 = ($obj2.$propName | ConvertTo-Json -Depth 10)
Add-CompareProperty $propName $val1 $val2 -Skip:($skipBasicProperties -eq $true)
Add-CompareProperty $propName $val1 $val2 -Skip:($skipPropertiesToCompare -contains $propName)
}
foreach ($propName in ($obj2.PSObject.Properties | Select Name).Name)
@@ -1185,7 +1426,7 @@ function Compare-ObjectsBasedonProperty
$val1 = ($obj1.$propName | ConvertTo-Json -Depth 10)
$val2 = ($obj2.$propName | ConvertTo-Json -Depth 10)
Add-CompareProperty $propName $val1 $val2
Add-CompareProperty $propName $val1 $val2 -Skip:($skipPropertiesToCompare -contains $propName)
}
$skipAssignments = Get-XamlProperty $script:cmpForm "chkSkipCompareAssignments" "IsChecked"
@@ -1508,4 +1749,46 @@ function Add-AssignmentInfo
{
Add-CompareProperty $assignmentStr $val1 $val2 -Category $assignment.GroupMode -match $match -Skip:($skipAssignments -eq $true)
}
}
}
function Invoke-SilentBatchJob
{
param($settingsObj)
if(-not $global:MSALToken) { return } # Skip if not authenticated
if($settingsObj.BulkCompare)
{
$global:currentViewObject = $global:viewObjects | Where { $_.ViewInfo.ID -eq "IntuneGraphAPI" }
$script:cmpForm = Get-XamlObject ($global:AppRootFolder + "\Xaml\BulkCompare.xaml") -AddVariables
if(-not $script:cmpForm) { return }
$script:compareObjects = Get-GraphBatchObjectTypes $settingsObj.BulkCompare
$global:cbCompareProvider.ItemsSource = @($global:compareProviders)
$global:cbCompareProvider.SelectedValue = ($settingsObj.BulkCompare | Where Name -eq "cbCompareProvider").Value
$global:cbCompareSave.ItemsSource = @($script:saveType)
$global:cbCompareSave.SelectedValue = ($settingsObj.BulkCompare | Where Name -eq "cbCompareSave").Value
$global:cbCompareType.ItemsSource = $global:comparisonTypes | Where ShowOnBulk -ne $false
$global:cbCompareType.SelectedValue = ($settingsObj.BulkCompare | Where Name -eq "cbCompareType").Value
$global:cbCompareCSVDelimiter.ItemsSource = @("", ",",";","-","|")
$global:cbCompareCSVDelimiter.SelectedValue = ($settingsObj.BulkCompare | Where Name -eq "cbCompareCSVDelimiter").Value
Set-CompareProviderOptions $global:cbCompareProvider
Set-BatchProperties $settingsObj.BulkCompare $script:cmpForm -SkipMissingControlWarning
Set-BatchProperties $settingsObj.BulkCompare $global:ccContentProviderOptions.Content -SkipMissingControlWarning
$global:dgObjectsToCompare.ItemsSource = @($script:compareObjects)
if($global:cbCompareProvider.SelectedItem.BulkCompare)
{
& $global:cbCompareProvider.SelectedItem.BulkCompare
}
}
}

View File

@@ -20,7 +20,7 @@ $global:documentationProviders = @()
function Get-ModuleVersion
{
'2.2.0'
'2.2.1'
}
function Invoke-InitializeModule
@@ -829,6 +829,10 @@ function Get-ObjectPlatformFromType
{
$platform = "Windows10"
}
elseif($lowerAppType.Contains("androidForWork"))
{
$platform = "androidForWork"
}
elseif($lowerAppType.Contains("android"))
{
$platform = "Android"
@@ -1916,7 +1920,7 @@ function Invoke-TranslateProfileObject
}
else
{
# Shuld only be one file. Compliance policies might have more
# Should only be one file. Compliance policies might have more
$files = [IO.Directory]::EnumerateFiles($global:AppRootFolder + "\Documentation\ObjectInfo", "*_$($objInfo.PolicyType).json")
if(($files | measure).Count -eq 0)
{
@@ -2655,7 +2659,8 @@ function Get-PropertyInfo
RawJsonValue=$jsonValue
DefaultValue=$defValue
FullValueTable = $tableValue
UnconfiguredValue=$prop.unconfiguredValue
UnconfiguredValue = $prop.unconfiguredValue
AlwaysAddValue = $prop.alwaysAddValue -eq $true
Enabled=$prop.Enabled
EntityKey=$prop.EntityKey
Level=$script:propLevel
@@ -4554,7 +4559,11 @@ function local:Invoke-StartDocumentatiom
break
}
if($global:chkSkipNotConfigured.IsChecked -and (($item.RawValue -isnot [array] -and ([String]::IsNullOrEmpty($item.RawValue) -or ("$($item.RawValue)" -eq "notConfigured"))) -or ($item.RawValue -is [array] -and ($item.RawValue | measure).Count -eq 0)))
if($item.AlwaysAddValue -eq $true)
{
}
elseif($global:chkSkipNotConfigured.IsChecked -and (($item.RawValue -isnot [array] -and ([String]::IsNullOrEmpty($item.RawValue) -or ("$($item.RawValue)" -eq "notConfigured"))) -or ($item.RawValue -is [array] -and ($item.RawValue | measure).Count -eq 0)))
{
# Skip unconfigured items e.g. properties with null values
# Note: This could removed configured properties if RawValue is not specified
@@ -4602,7 +4611,7 @@ function local:Invoke-StartDocumentatiom
}
$documentedObj | Add-Member Noteproperty -Name "FilteredSettings" -Value $filteredSettings -Force
& $global:cbDocumentationType.SelectedItem.Process $obj.Object $obj.ObjectType $documentedObj
}
}

View File

@@ -10,7 +10,7 @@ This module will also document some objects based on PowerShell functions
function Get-ModuleVersion
{
'1.6.4'
'1.6.5'
}
function Invoke-InitializeModule
@@ -76,9 +76,18 @@ function Invoke-CDDocumentObject
Properties = @("Name","Value")
}
}
elseif($type -eq '#microsoft.graph.iosMobileAppConfiguration')
elseif($type -eq '#microsoft.graph.androidManagedStoreAppConfiguration') {
Invoke-CDDocumentAndroidManagedStoreAppConfiguration $documentationObj
return [PSCustomObject]@{
Properties = @("Name","Value","Category","SubCategory")
}
}
elseif($type -eq '#microsoft.graph.androidForWorkMobileAppConfiguration' -or
$type -eq '#microsoft.graph.iosMobileAppConfiguration')
{
Invoke-CDDocumentiosMobileAppConfiguration $documentationObj
Invoke-CDDocumentMobileAppConfiguration $documentationObj
return [PSCustomObject]@{
Properties = @("Name","Value","Category","SubCategory")
}
@@ -1331,9 +1340,16 @@ function Add-CDDocumentCustomProfileProperty
{
if($obj.ScriptContent)
{
Add-ObjectScript $obj.FileName ("{1} - {0}" -f $obj.displayName,(Get-LanguageString "WindowsManagement.shellScriptObjectName")) $rule.ScriptContent
Add-ObjectScript $obj.FileName ("{1} - {0}" -f $obj.displayName,(Get-LanguageString "WindowsManagement.shellScriptObjectName")) $obj.ScriptContent
}
}
elseif($obj.'@OData.Type' -eq "#microsoft.graph.deviceCustomAttributeShellScript")
{
if($obj.ScriptContent)
{
Add-ObjectScript $obj.FileName ("{1} - {0}" -f $obj.displayName,(Get-LanguageString "WindowsManagement.customAttributeObjectName")) $obj.ScriptContent
}
}
elseif($obj.'@OData.Type' -eq "#microsoft.graph.windows10TeamGeneralConfiguration")
{
$obj | Add-Member Noteproperty -Name "syntheticAzureOperationalInsightsEnabled" -Value ($obj.azureOperationalInsightsBlockTelemetry -eq $false)
@@ -1823,7 +1839,105 @@ function Get-CDDocumentOperatorString
}
# App Config
function Invoke-CDDocumentiosMobileAppConfiguration
function Invoke-CDDocumentAndroidManagedStoreAppConfiguration
{
param($documentationObj)
$obj = $documentationObj.Object
$objectType = $documentationObj.ObjectType
$script:objectSeparator = ?? $global:cbDocumentationObjectSeparator.SelectedValue ([System.Environment]::NewLine)
$script:propertySeparator = ?? $global:cbDocumentationPropertySeparator.SelectedValue ","
###################################################
# Basic info
###################################################
Add-BasicDefaultValues $obj $objectType
Add-BasicAdditionalValues $obj $objectType
#Add-BasicPropertyValue (Get-LanguageString "TableHeaders.configurationType") (Get-LanguageString "SettingDetails.appConfiguration")
#Add-BasicPropertyValue (Get-LanguageString "Inputs.enrollmentTypeLabel") (Get-LanguageString "EnrollmentType.devicesWithEnrollment")
$allApps = Get-CDAllTenantApps
$appsList = @()
foreach($id in ($obj.targetedMobileApps))
{
$tmpApp = $allApps | Where Id -eq $id
$appsList += ?? $tmpApp.displayName $id
}
Add-BasicPropertyValue (Get-LanguageString "SettingDetails.targetedAppLabel") ($appsList -join $objSeparator)
$category = Get-LanguageString "TableHeaders.settings"
if($obj.payloadJson)
{
$payloadData = $null
try
{
$payloadData = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($obj.payloadJson)) | ConvertFrom-Json
}
catch
{
Write-LogError "Failed to get Json payload" $_.Exception
return
}
# Not the best way. BundleId should be used but then full app info is required
if($obj.packageId -eq "com.microsoft.office.outlook*")
{
if([IO.File]::Exists(($global:AppRootFolder + "\Documentation\ObjectInfo\#AppConfigOutlookDevice.json")))
{
$tmp = $obj.settings | Where { $_.appConfigKey -eq "com.microsoft.outlook.EmailProfile.AccountType" }
if($tmp){ $configEmail=$true }else{ $configEmail=$false }
$outlookSettings = [PSCustomObject]@{
configureEmail = $configEmail
}
foreach($setting in $obj.settings)
{
if($setting.appConfigKeyType -eq "booleanType")
{
$value = $setting.appConfigKeyValue -eq "true"
}
else
{
$value = $setting.appConfigKeyValue
}
$outlookSettings | Add-Member Noteproperty -Name $setting.appConfigKey -Value $value -Force
}
$jsonObj = Get-Content ($global:AppRootFolder + "\Documentation\ObjectInfo\#AppConfigOutlookDevice.json") | ConvertFrom-Json
Invoke-TranslateSection $outlookSettings $jsonObj
}
}
$addedSettings = Get-DocumentedSettings
foreach($managedProperty in $payloadData.managedProperty)
{
if(($addedSettings | Where EntityKey -eq $managedProperty.key)) { continue }
$valueProperty = $managedProperty.PSObject.Properties | Where-Object Name -like "value*"
$value = $valueProperty.value
if($value -is [Array]) {
$value = $value -join ","
}
Add-CustomSettingObject ([PSCustomObject]@{
Name = $managedProperty.key
Value = $value
EntityKey = $managedProperty.key
Category = Get-LanguageString "TACSettings.generalSettings"
SubCategory = Get-LanguageString "SettingDetails.additionalConfiguration"
})
}
}
}
function Invoke-CDDocumentMobileAppConfiguration
{
param($documentationObj)
@@ -1889,7 +2003,7 @@ function Invoke-CDDocumentiosMobileAppConfiguration
else
{
# Not the best way. BundleId should be used but then full app info is required
if(($obj.settings | Where { $_.appConfigKey -like "com.microsoft.outlook*" }))
if(($obj.packageId | Where { $_.appConfigKey -like "com.microsoft.outlook*" }))
{
if([IO.File]::Exists(($global:AppRootFolder + "\Documentation\ObjectInfo\#AppConfigOutlookDevice.json")))
{

View File

@@ -10,7 +10,7 @@ This module is for the Endpoint Manager/Intune View. It manages Export/Import/Co
#>
function Get-ModuleVersion
{
'3.9.6'
'3.9.7'
}
function Invoke-InitializeModule
@@ -216,6 +216,21 @@ function Invoke-InitializeModule
GroupId = "CompliancePolicies"
})
Add-ViewItem (New-Object PSObject -Property @{
Title = "Compliance Policies - V2"
Id = "CompliancePoliciesV2"
ViewID = "IntuneGraphAPI"
API = "/deviceManagement/compliancePolicies"
NameProperty = "Name"
PropertiesToRemove = @('settingCount')
ViewProperties = @("name","description","Id")
Expand="settings"
Permissons=@("DeviceManagementConfiguration.ReadWrite.All")
GroupId = "CompliancePolicies"
Icon = "CompliancePolicies"
})
Add-ViewItem (New-Object PSObject -Property @{
Title = "Compliance Scripts"
Id = "ComplianceScripts"
@@ -391,6 +406,8 @@ function Invoke-InitializeModule
Icon="CustomAttributes"
GroupId = "CustomAttributes" # MacOS Settings
DetailExtension = { Add-ScriptExtensions @args }
ExportExtension = { Add-ScriptExportExtensions @args }
PostExportCommand = { Start-PostExportScripts @args }
PropertiesToRemoveForUpdate = @('customAttributeName','customAttributeType','displayName')
#PreUpdateCommand = { Start-PreUpdateMacCustomAttributes @args }
})
@@ -1348,7 +1365,7 @@ function Start-PostExportCompliancePolicies
foreach($notificationMessageCCGroup in $scheduledActionConfiguration.notificationMessageCCList)
{
Add-GroupMigrationObject $notificationMessageCCGroup
}
}
}
}
}

View File

@@ -518,6 +518,7 @@ function Write-AzureStorageChunk
$encodedBody = $iso.GetString($body)
$headers = @{
"x-ms-blob-type" = "BlockBlob"
"Content-Type" = "application/octet-stream"
}
$curProgressPreference = $ProgressPreference

View File

@@ -10,7 +10,7 @@ This module manages Authentication for the application with MSAL. It is also res
#>
function Get-ModuleVersion
{
'3.9.3'
'3.9.7'
}
$global:msalAuthenticator = $null
@@ -1809,7 +1809,8 @@ function Get-MSALProfileEllipse
{
try
{
$lbObj = [Windows.Markup.XamlReader]::Parse("<TextBlock $wpfNS HorizontalAlignment=`"Stretch`"><Bold>$($tenant.DisplayName)</Bold><LineBreak/>$($tenant.defaultDomain)<LineBreak/>$($tenant.tenantId)</TextBlock>")
$tenantName = [System.Web.HttpUtility]::HtmlEncode($tenant.DisplayName)
$lbObj = [Windows.Markup.XamlReader]::Parse("<TextBlock $wpfNS HorizontalAlignment=`"Stretch`"><Bold>$($tenantName)</Bold><LineBreak/>$($tenant.defaultDomain)<LineBreak/>$($tenant.tenantId)</TextBlock>")
if($tenant.tenantId -ne $global:MSALToken.TenantId)
{
@@ -1950,7 +1951,7 @@ function local:Add-CachedUser
$icon.Margin = "0,0,5,0"
$grdLogin.Children.Add($icon) | Out-Null
$tenantName = Get-Setting $account.HomeAccountId.TenantId "_Name" $account.HomeAccountId.TenantId
$tenantName = [System.Web.HttpUtility]::HtmlEncode((Get-Setting $account.HomeAccountId.TenantId "_Name" $account.HomeAccountId.TenantId))
$lbObj = [Windows.Markup.XamlReader]::Parse("<TextBlock $wpfNS>$($account.UserName)<LineBreak/>$($tenantName)</TextBlock>")
$lbObj.SetValue([System.Windows.Controls.Grid]::ColumnProperty,1)