This commit is contained in:
Mikael Karlsson
2024-10-12 12:53:24 +11:00
parent 5326bd5525
commit c6fcf58d4d
37 changed files with 93455 additions and 92040 deletions

View File

@@ -12,7 +12,7 @@
RootModule = 'CloudAPIPowerShellManagement.psm1' RootModule = 'CloudAPIPowerShellManagement.psm1'
# Version number of this module. # Version number of this module.
ModuleVersion = '3.9.7' ModuleVersion = '3.9.8'
# Supported PSEditions # Supported PSEditions
# CompatiblePSEditions = @() # CompatiblePSEditions = @()

View File

@@ -470,7 +470,7 @@
] ]
}, },
{ {
"ObjectType": "#microsoft.graph.hardwareConfiguration", "ObjectType": "#microsoft.graph.hardwareConfigurations",
"PolicyType": "HardwareConfigurations", "PolicyType": "HardwareConfigurations",
"PolicyTypeLanguageId": "hardwareConfigurations", "PolicyTypeLanguageId": "hardwareConfigurations",
"PlatformLanguageId": "Windows10", "PlatformLanguageId": "Windows10",

View File

@@ -85,32 +85,48 @@
"enabled": true "enabled": true
}, },
{ {
"dataType": 0, "dataType": 16,
"category": 2, "category": 2,
"nameResourceKey": "publicPlayStoreEnabledName", "nameResourceKey": "publicPlayStoreEnabledName",
"descriptionResourceKey": "publicPlayStoreEnabledDescription", "descriptionResourceKey": "publicPlayStoreEnabledDescription",
"childSettings": [ "childSettings": [
{
"dataType": 10,
"category": 2,
"nameResourceKey": "publicPlayStoreEnabledWarning",
"childSettings": [
], ],
"options": [ "options": [
{
"nameResourceKey": "publicPlayStoreSelectionNotConfigured",
"value": "notConfigured",
"enabled": true
},
{
"nameResourceKey": "publicPlayStoreSelectionAllowList",
"value": "allowList",
"enabled": true
},
{
"nameResourceKey": "publicPlayStoreSelectionBlockList",
"value": "blockList",
"enabled": true
}
],
"entityKey": "playStoreMode",
"booleanActions": 0,
"defaultValue": "notConfigured",
"unconfiguredValue": "notConfigured",
"policyType": 2,
"enabled": true
},
{
"dataType": 10,
"category": 2,
"nameResourceKey": "publicPlayStoreEnabledWarning",
"childSettings": [
],
"booleanActions": 0,
"policyType": 2,
"enabled": true
}
], ],
"options": [ "options": [
], ],
"entityKey": "publicPlayStoreEnabled",
"booleanActions": 0, "booleanActions": 0,
"defaultValue": false,
"policyType": 2, "policyType": 2,
"enabled": true "enabled": true
}, },

View File

@@ -1150,8 +1150,8 @@
"showAsSectionHeader": true, "showAsSectionHeader": true,
"dataType": 8, "dataType": 8,
"category": 44, "category": 44,
"nameResourceKey": "dedicatedAndroidEnrollmentTypesHeaderName", "nameResourceKey": "fullyManagedAndDedicatedAndroidEnrollmentTypesWithKioskHeaderName",
"descriptionResourceKey": "dedicatedAndroidEnrollmentTypesHeaderDescription", "descriptionResourceKey": "fullyManagedAndDedicatedAndroidEnrollmentTypesWithKioskHeaderDescription",
"childSettings": [ "childSettings": [
{ {
"dataType": 0, "dataType": 0,
@@ -1267,7 +1267,23 @@
"defaultValue": false, "defaultValue": false,
"policyType": 2, "policyType": 2,
"enabled": false "enabled": false
}, }
],
"options": [
],
"booleanActions": 0,
"policyType": 2,
"enabled": true
},
{
"isSettingDescription": false,
"showAsSectionHeader": true,
"dataType": 8,
"category": 44,
"nameResourceKey": "dedicatedAndroidEnrollmentTypesHeaderName",
"descriptionResourceKey": "dedicatedAndroidEnrollmentTypesHeaderDescription",
"childSettings": [
{ {
"dataType": 0, "dataType": 0,
"category": 44, "category": 44,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,7 @@ Objects can be compared based on Properties or Documentatation info.
function Get-ModuleVersion function Get-ModuleVersion
{ {
'1.1.0' '1.2.0'
} }
function Invoke-InitializeModule function Invoke-InitializeModule
@@ -639,7 +639,8 @@ function Start-BulkCompareExportObjects
else else
{ {
$sourceObj = Get-GraphObject $curObject.Object $curObject.ObjectType $sourceObj = Get-GraphObject $curObject.Object $curObject.ObjectType
$fileObj.Object | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force $fileObj.Object | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force
$fileObj.Object | Add-Member Noteproperty -Name "@ObjectFileName" -Value $fileObj.FileInfo.FullName -Force
$compareProperties = Compare-Objects $sourceObj.Object $fileObj.Object $item.ObjectType $compareProperties = Compare-Objects $sourceObj.Object $fileObj.Object $item.ObjectType
} }
@@ -825,7 +826,8 @@ function Start-BulkCompareExportIntuneToNamedExportedObjects
else else
{ {
$sourceObj = Get-GraphObject $graphObject.Object $graphObject.ObjectType $sourceObj = Get-GraphObject $graphObject.Object $graphObject.ObjectType
$fileObj.Object | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force $fileObj.Object | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force
$fileObj.Object | Add-Member Noteproperty -Name "@ObjectFileName" -Value $fileObj.FileInfo.FullName -Force
$compareProperties = Compare-Objects $sourceObj.Object $fileObj.Object $item.ObjectType $compareProperties = Compare-Objects $sourceObj.Object $fileObj.Object $item.ObjectType
} }
@@ -1008,8 +1010,10 @@ function Start-BulkCompareExportFolders
} }
else else
{ {
$fileSourceObj.Object | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force $fileSourceObj.Object | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force
$fileSourceObj.Object | Add-Member Noteproperty -Name "@ObjectFileName" -Value $fileSourceObj.FileInfo.FullName -Force
$compareObject.Object | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force $compareObject.Object | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force
$compareObject.Object | Add-Member Noteproperty -Name "@ObjectFileName" -Value $compareObject.FileInfo.FullName -Force
$compareProperties = Compare-Objects $compareObject.Object $fileSourceObj.Object $item.ObjectType $compareProperties = Compare-Objects $compareObject.Object $fileSourceObj.Object $item.ObjectType
} }
@@ -1297,6 +1301,7 @@ function Start-CompareExportObject
} }
} }
$compareObj | Add-Member Noteproperty -Name "@ObjectFileName" -Value $global:txtCompareFile.Text -Force
$compareObj | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force $compareObj | Add-Member Noteproperty -Name "@ObjectFromFile" -Value $true -Force
$compareResult = Compare-Objects $obj.Object $compareObj $obj.ObjectType $compareResult = Compare-Objects $obj.Object $compareObj $obj.ObjectType
@@ -1381,7 +1386,7 @@ function Compare-ObjectsBasedonProperty
$coreProps = @((?? $objectType.NameProperty "displayName"), "Description", "Id", "createdDateTime", "lastModifiedDateTime", "version") $coreProps = @((?? $objectType.NameProperty "displayName"), "Description", "Id", "createdDateTime", "lastModifiedDateTime", "version")
$postProps = @("Advertisements") $postProps = @("Advertisements")
$skipProps = @("@ObjectFromFile") $skipProps = @("@ObjectFromFile","@ObjectFileName")
$skipPropertiesToCompare = @() $skipPropertiesToCompare = @()
if($skipBasicProperties) { if($skipBasicProperties) {
$skipPropertiesToCompare += "roleScopeTagIds" $skipPropertiesToCompare += "roleScopeTagIds"

View File

@@ -20,7 +20,7 @@ $global:documentationProviders = @()
function Get-ModuleVersion function Get-ModuleVersion
{ {
'2.2.1' '2.3.0'
} }
function Invoke-InitializeModule function Invoke-InitializeModule
@@ -228,6 +228,7 @@ function Get-ObjectDocumentation
$script:applicabilityRules = @() $script:applicabilityRules = @()
$script:objectAssignments = @() $script:objectAssignments = @()
$script:objectScripts = @() $script:objectScripts = @()
$script:customTables = @()
$script:admxCategories = $null $script:admxCategories = $null
$script:ObjectTypeFullTable = @{} # Hash table with objects that should be documented in a single table eg ScopeTags $script:ObjectTypeFullTable = @{} # Hash table with objects that should be documented in a single table eg ScopeTags
@@ -351,6 +352,7 @@ function Get-ObjectDocumentation
Settings = $script:objectSettingsData Settings = $script:objectSettingsData
ComplianceActions = $script:objectComplianceActionData ComplianceActions = $script:objectComplianceActionData
ApplicabilityRules = $script:applicabilityRules ApplicabilityRules = $script:applicabilityRules
CustomTables = $script:customTables
Assignments = $script:objectAssignments Assignments = $script:objectAssignments
Scripts = $script:objectScripts Scripts = $script:objectScripts
DisplayProperties = $properties DisplayProperties = $properties
@@ -386,11 +388,40 @@ function Invoke-ObjectDocumentation
$global:intentCategoryDefs = $null $global:intentCategoryDefs = $null
$global:cfgCategories = $null $global:cfgCategories = $null
$script:admxCategories = $null $script:admxCategories = $null
$script:migTable = $null
$script:DocumentationLanguage = "en" $script:DocumentationLanguage = "en"
$script:objectSeparator = [System.Environment]::NewLine $script:objectSeparator = [System.Environment]::NewLine
$script:propertySeparator = "," $script:propertySeparator = ","
$loadExportedInfo = $false
if($documentationObj.Object."@ObjectFileName") {
$path = [IO.Path]::GetDirectoryName($documentationObj.Object."@ObjectFileName")
for($i = 0;$i -lt 2;$i++)
{
if($i -gt 0)
{
# Get parent directory
$path = [io.path]::GetDirectoryName($path)
}
$migFileName = Join-Path $path "MigrationTable.json"
try
{
if([IO.File]::Exists($migFileName))
{
Write-Log "Load Migration table from $migFileName"
$script:migTable = ConvertFrom-Json (Get-Content $migFileName -Raw)
}
}
catch {}
}
if(-not $script:migTable) {
Write-Log "Migration table not found" 2
}
}
Get-ObjectDocumentation $documentationObj Get-ObjectDocumentation $documentationObj
} }
@@ -636,6 +667,19 @@ function Add-BasicDefaultValues
} }
} }
function Add-CustomTable
{
param($TableId, $Columns = @("Name", "Value"), $Values, [int]$Order = 100, $LanguageId = "")
$script:customTables += [PSCustomObject]@{
Id = $TableId
Columns = $Columns
Values = $Values
LanguageId = $LanguageId
Order = $Order
}
}
function Add-BasicAdditionalValues function Add-BasicAdditionalValues
{ {
param($obj, $objectType) param($obj, $objectType)
@@ -4385,7 +4429,7 @@ function local:Invoke-StartDocumentatiom
$migFileName = [IO.Path]::Combine($diSource.FullName,"MigrationTable.json") $migFileName = [IO.Path]::Combine($diSource.FullName,"MigrationTable.json")
if([IO.File]::Exists($migFileName) -eq $false) if([IO.File]::Exists($migFileName) -eq $false)
{ {
Write-Log "MigrationTable not found. Groups will be documented with GroupId" 2 Write-Log "MigrationTable not found. Groups will be documented with GroupId" 2
} }
else else
{ {
@@ -4927,7 +4971,11 @@ function Invoke-CSVProcessItem
{ {
if($documentedObj.Assignments[0].RawIntent) if($documentedObj.Assignments[0].RawIntent)
{ {
$properties = @("GroupMode","Group","Category","SubCategory") $properties = @("GroupMode","Group","Category","SubCategory")
}
elseif($documentedObj.Assignments[0].Group)
{
$properties = @("GroupMode","Group","Category")
} }
else else
{ {

View File

@@ -10,7 +10,7 @@ This module will also document some objects based on PowerShell functions
function Get-ModuleVersion function Get-ModuleVersion
{ {
'1.6.5' '1.6.6'
} }
function Invoke-InitializeModule function Invoke-InitializeModule
@@ -76,7 +76,8 @@ function Invoke-CDDocumentObject
Properties = @("Name","Value") Properties = @("Name","Value")
} }
} }
elseif($type -eq '#microsoft.graph.androidManagedStoreAppConfiguration') { elseif($type -eq '#microsoft.graph.androidForWorkMobileAppConfiguration' -or
$type -eq '#microsoft.graph.androidManagedStoreAppConfiguration') {
Invoke-CDDocumentAndroidManagedStoreAppConfiguration $documentationObj Invoke-CDDocumentAndroidManagedStoreAppConfiguration $documentationObj
@@ -84,8 +85,7 @@ function Invoke-CDDocumentObject
Properties = @("Name","Value","Category","SubCategory") Properties = @("Name","Value","Category","SubCategory")
} }
} }
elseif($type -eq '#microsoft.graph.androidForWorkMobileAppConfiguration' -or elseif($type -eq '#microsoft.graph.iosMobileAppConfiguration')
$type -eq '#microsoft.graph.iosMobileAppConfiguration')
{ {
Invoke-CDDocumentMobileAppConfiguration $documentationObj Invoke-CDDocumentMobileAppConfiguration $documentationObj
return [PSCustomObject]@{ return [PSCustomObject]@{
@@ -186,7 +186,7 @@ function Get-CDAllCloudApps
{ {
if(-not $script:allCloudApps) if(-not $script:allCloudApps)
{ {
$script:allCloudApps = (Invoke-GraphRequest -url "/servicePrincipals?`$select=displayName,appId&top=999" -ODataMetadata "minimal").value $script:allCloudApps = (Invoke-GraphRequest -url "/servicePrincipals?`$select=displayName,appId&top=999" -ODataMetadata "minimal" -AllPages).value
} }
$script:allCloudApps $script:allCloudApps
} }
@@ -198,7 +198,7 @@ function Get-CDAllTenantApps
$script:allTenantApps = Get-DocOfflineObjects "Applications" $script:allTenantApps = Get-DocOfflineObjects "Applications"
if(-not $script:allTenantApps) if(-not $script:allTenantApps)
{ {
$script:allTenantApps =(Invoke-GraphRequest -url "/deviceAppManagement/mobileApps?`$select=displayName,id&top=999" -ODataMetadata "minimal").value $script:allTenantApps =(Invoke-GraphRequest -url "/deviceAppManagement/mobileApps?`$select=displayName,id&top=999" -ODataMetadata "minimal" -AllPages).value
} }
} }
$script:allTenantApps $script:allTenantApps
@@ -1885,26 +1885,20 @@ function Invoke-CDDocumentAndroidManagedStoreAppConfiguration
} }
# Not the best way. BundleId should be used but then full app info is required # Not the best way. BundleId should be used but then full app info is required
if($obj.packageId -eq "com.microsoft.office.outlook*") if($obj.packageId -eq "com.microsoft.office.outlook")
{ {
if([IO.File]::Exists(($global:AppRootFolder + "\Documentation\ObjectInfo\#AppConfigOutlookDevice.json"))) if([IO.File]::Exists(($global:AppRootFolder + "\Documentation\ObjectInfo\#AppConfigOutlookDevice.json")))
{ {
$tmp = $obj.settings | Where { $_.appConfigKey -eq "com.microsoft.outlook.EmailProfile.AccountType" } $tmp = $payloadData.managedProperty | Where { $_.key -eq "com.microsoft.outlook.EmailProfile.AccountType" }
if($tmp){ $configEmail=$true }else{ $configEmail=$false } if($tmp){ $configEmail=$true }else{ $configEmail=$false }
$outlookSettings = [PSCustomObject]@{ $outlookSettings = [PSCustomObject]@{
configureEmail = $configEmail configureEmail = $configEmail
} }
foreach($setting in $obj.settings)
foreach($managedProperty in $payloadData.managedProperty)
{ {
if($setting.appConfigKeyType -eq "booleanType") $valueProperty = $managedProperty.PSObject.Properties | Where-Object Name -like "value*"
{ $outlookSettings | Add-Member Noteproperty -Name $managedProperty.key -Value $valueProperty.Value -Force
$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 $jsonObj = Get-Content ($global:AppRootFolder + "\Documentation\ObjectInfo\#AppConfigOutlookDevice.json") | ConvertFrom-Json
@@ -1914,6 +1908,8 @@ function Invoke-CDDocumentAndroidManagedStoreAppConfiguration
$addedSettings = Get-DocumentedSettings $addedSettings = Get-DocumentedSettings
$additionalSettings = @()
foreach($managedProperty in $payloadData.managedProperty) foreach($managedProperty in $payloadData.managedProperty)
{ {
if(($addedSettings | Where EntityKey -eq $managedProperty.key)) { continue } if(($addedSettings | Where EntityKey -eq $managedProperty.key)) { continue }
@@ -1926,14 +1922,44 @@ function Invoke-CDDocumentAndroidManagedStoreAppConfiguration
$value = $value -join "," $value = $value -join ","
} }
Add-CustomSettingObject ([PSCustomObject]@{ $additionalSettings += ([PSCustomObject]@{
Name = $managedProperty.key Name = $managedProperty.key
ValueType = $valueProperty.Name.SubString(5)
Value = $value Value = $value
EntityKey = $managedProperty.key EntityKey = $managedProperty.key
Category = Get-LanguageString "TACSettings.generalSettings" Category = Get-LanguageString "TACSettings.generalSettings"
SubCategory = Get-LanguageString "SettingDetails.additionalConfiguration" SubCategory = Get-LanguageString "SettingDetails.additionalConfiguration"
}) })
} }
if($additionalSettings.Count -gt 0) {
Add-CustomTable "AdditionalSettings" @("Name","ValueType","Value") $additionalSettings -Order 110
}
$permissions = @()
foreach($permission in $obj.permissionActions)
{
$permissionTemp = $permission.permission.Split('.')[-1]
if($permissionTemp) {
$permissionLngId = $permissionTemp -replace "_", ""
$permissionStr = ?? (Get-LanguageString "AndroidForWorkAppPermissions.Permissions.$($permissionLngId)") $permissionTemp
}
else {
$permissionStr = $permission.permission
}
$permissions += ([PSCustomObject]@{
Permission = $permissionStr
Action = ?? (Get-LanguageString "AndroidForWorkAppPermissions.Action.$($permission.action)") $permission.action
EntityKey = $permission.permission
})
}
if($permissions.Count -gt 0) {
Add-CustomTable "Permissions" @("Permission","Action") $permissions -Order 115 -LanguageId "AndroidForWorkAppPermissions.permissionsTitle"
}
} }
} }
@@ -2002,8 +2028,18 @@ function Invoke-CDDocumentMobileAppConfiguration
} }
else else
{ {
$isOutlook = $false
foreach($targetedAppId in $obj.targetedMobileApps) {
$app = $allApps | Where Id -eq $targetedAppId
if($app.displayName -eq "Microsoft Outlook") {
$isOutlook = $true
break
}
}
# Not the best way. BundleId should be used but then full app info is required # Not the best way. BundleId should be used but then full app info is required
if(($obj.packageId | Where { $_.appConfigKey -like "com.microsoft.outlook*" })) if($isOutlook -or ($obj.packageId | Where { $_.appConfigKey -like "com.microsoft.outlook*" }))
{ {
if([IO.File]::Exists(($global:AppRootFolder + "\Documentation\ObjectInfo\#AppConfigOutlookDevice.json"))) if([IO.File]::Exists(($global:AppRootFolder + "\Documentation\ObjectInfo\#AppConfigOutlookDevice.json")))
{ {
@@ -3139,7 +3175,7 @@ function Invoke-CDDocumentConditionalAccess
Add-CustomSettingObject ([PSCustomObject]@{ Add-CustomSettingObject ([PSCustomObject]@{
Name = Get-LanguageString "AzureCA.WhatIfBlade.authenticationStrength" Name = Get-LanguageString "AzureCA.WhatIfBlade.authenticationStrength"
Value = $termsOfUse -join $script:objectSeparator Value = $authenticationStrngth -join $script:objectSeparator
Category = $category Category = $category
SubCategory = "" SubCategory = ""
EntityKey = "authenticationStrength" EntityKey = "authenticationStrength"

View File

@@ -1,6 +1,6 @@
function Get-ModuleVersion function Get-ModuleVersion
{ {
'1.0.1' '1.1.0'
} }
function Invoke-InitializeModule function Invoke-InitializeModule
@@ -332,7 +332,9 @@ function Invoke-HTMLProcessItem
$lngId = ?: ($tableType -eq "BasicInfo") "SettingDetails.basics" "TableHeaders.settings" -AddCategories $lngId = ?: ($tableType -eq "BasicInfo") "SettingDetails.basics" "TableHeaders.settings" -AddCategories
Add-HTMLTableItems $obj $objectType ($documentedObj.$tableType) $properties $lngId -AddCategories -AddSubcategories if(($documentedObj.$tableType).Count -gt 0) {
Add-HTMLTableItems $obj $objectType ($documentedObj.$tableType) $properties $lngId -AddCategories -AddSubcategories
}
} }
if(($documentedObj.ComplianceActions | measure).Count -gt 0) if(($documentedObj.ComplianceActions | measure).Count -gt 0)
@@ -351,6 +353,11 @@ function Invoke-HTMLProcessItem
Add-HTMLObjectSettings $obj $objectType $documentedObj Add-HTMLObjectSettings $obj $objectType $documentedObj
foreach($customTable in ($documentedObj.CustomTables | Sort-Object -Property Order))
{
Add-HTMLTableItems $obj $objectType $customTable.Values $customTable.Columns $customTable.LanguageId -AddCategories -AddSubcategories
}
if(($documentedObj.Assignments | measure).Count -gt 0) if(($documentedObj.Assignments | measure).Count -gt 0)
{ {
if($documentedObj.Assignments[0].RawIntent) if($documentedObj.Assignments[0].RawIntent)

View File

@@ -1,6 +1,6 @@
function Get-ModuleVersion function Get-ModuleVersion
{ {
'1.1.1' '1.2.0'
} }
function Invoke-InitializeModule function Invoke-InitializeModule
@@ -285,7 +285,9 @@ function Invoke-MDProcessItem
$lngId = ?: ($tableType -eq "BasicInfo") "SettingDetails.basics" "TableHeaders.settings" -AddCategories $lngId = ?: ($tableType -eq "BasicInfo") "SettingDetails.basics" "TableHeaders.settings" -AddCategories
Add-MDTableItems $obj $objectType ($documentedObj.$tableType) $properties $lngId -AddCategories -AddSubcategories if(($documentedObj.$tableType).Count -gt 0) {
Add-MDTableItems $obj $objectType ($documentedObj.$tableType) $properties $lngId -AddCategories -AddSubcategories
}
#Add-MDTableItems $obj $objectType ($documentedObj.$tableType) $properties $lngId ` #Add-MDTableItems $obj $objectType ($documentedObj.$tableType) $properties $lngId `
# -AddCategories:($global:chkMDAddCategories.IsChecked -eq $true) ` # -AddCategories:($global:chkMDAddCategories.IsChecked -eq $true) `
@@ -308,6 +310,11 @@ function Invoke-MDProcessItem
Add-MDObjectSettings $obj $objectType $documentedObj Add-MDObjectSettings $obj $objectType $documentedObj
foreach($customTable in ($documentedObj.CustomTables | Sort-Object -Property Order))
{
Add-MDTableItems $obj $objectType $documentedObj $customTable.Values $customTable.Columns $customTable.LanguageId -AddCategories -AddSubcategories
}
if(($documentedObj.Assignments | measure).Count -gt 0) if(($documentedObj.Assignments | measure).Count -gt 0)
{ {
if($documentedObj.Assignments[0].RawIntent) if($documentedObj.Assignments[0].RawIntent)

View File

@@ -3,7 +3,7 @@
#https://docs.microsoft.com/en-us/office/vba/api/overview/word #https://docs.microsoft.com/en-us/office/vba/api/overview/word
function Get-ModuleVersion function Get-ModuleVersion
{ {
'1.6.0' '1.7.0'
} }
function Invoke-InitializeModule function Invoke-InitializeModule
@@ -208,7 +208,7 @@ function Invoke-WordPreProcessItems
{ {
try try
{ {
$script:doc = $wordApp.Documents.Add($global:txtWordDocumentTemplate.Text) $script:doc = $script:wordApp.Documents.Add($global:txtWordDocumentTemplate.Text)
} }
catch catch
{ {
@@ -217,7 +217,7 @@ function Invoke-WordPreProcessItems
} }
else else
{ {
$script:doc = $wordApp.Documents.Add() $script:doc = $script:wordApp.Documents.Add()
} }
#Get BuiltIn properties #Get BuiltIn properties
@@ -547,10 +547,12 @@ function Invoke-WordProcessItem
$lngId = ?: ($tableType -eq "BasicInfo") "SettingDetails.basics" "TableHeaders.settings" -AddCategories $lngId = ?: ($tableType -eq "BasicInfo") "SettingDetails.basics" "TableHeaders.settings" -AddCategories
Add-DocTableItems $obj $objectType ($documentedObj.$tableType) $properties $lngId ` if(($documentedObj.$tableType).Count -gt 0) {
Add-DocTableItems $obj $objectType ($documentedObj.$tableType) $properties $lngId `
-AddCategories:($global:chkWordAddCategories.IsChecked -eq $true) ` -AddCategories:($global:chkWordAddCategories.IsChecked -eq $true) `
-AddSubcategories:($global:chkWordAddSubCategories.IsChecked -eq $true) ` -AddSubcategories:($global:chkWordAddSubCategories.IsChecked -eq $true) `
-ForceFullValue:($tableType -eq "BasicInfo") -ForceFullValue:($tableType -eq "BasicInfo")
}
} }
if($global:cbWordDocumentationLevel.SelectedValue -ne "basic") if($global:cbWordDocumentationLevel.SelectedValue -ne "basic")
@@ -570,6 +572,11 @@ function Invoke-WordProcessItem
} }
Add-DocObjectSettings $obj $objectType $documentedObj Add-DocObjectSettings $obj $objectType $documentedObj
foreach($customTable in ($documentedObj.CustomTables | Sort-Object -Property Order))
{
Add-DocTableItems $obj $objectType $documentedObj $customTable.Values $customTable.Columns $customTable.LanguageId -AddCategories -AddSubcategories
}
} }
if(($documentedObj.Assignments | measure).Count -gt 0) if(($documentedObj.Assignments | measure).Count -gt 0)

View File

@@ -10,7 +10,7 @@ This module is for the Endpoint Manager/Intune View. It manages Export/Import/Co
#> #>
function Get-ModuleVersion function Get-ModuleVersion
{ {
'3.9.7' '3.9.8'
} }
function Invoke-InitializeModule function Invoke-InitializeModule
@@ -472,8 +472,9 @@ function Invoke-InitializeModule
ViewID = "IntuneGraphAPI" ViewID = "IntuneGraphAPI"
Permissons=@("DeviceManagementApps.ReadWrite.All") Permissons=@("DeviceManagementApps.ReadWrite.All")
Dependencies = @("Applications") Dependencies = @("Applications")
PreFilesImportCommand = { Start-PreFilesImportAppConfiguration @args }
PreImportAssignmentsCommand = { Start-PreImportAssignmentsAppConfiguration @args } PreImportAssignmentsCommand = { Start-PreImportAssignmentsAppConfiguration @args }
#PostExportCommand = { Start-PostExportAppConfiguration @args } PostExportCommand = { Start-PostExportAppConfiguration @args }
Icon = "AppConfiguration" Icon = "AppConfiguration"
GroupId = "AppConfiguration" GroupId = "AppConfiguration"
}) })
@@ -674,6 +675,8 @@ function Invoke-InitializeModule
QUERYLIST = "`$filter=microsoft.graph.androidManagedStoreAppConfiguration/appSupportsOemConfig%20eq%20true" QUERYLIST = "`$filter=microsoft.graph.androidManagedStoreAppConfiguration/appSupportsOemConfig%20eq%20true"
API = "/deviceAppManagement/mobileAppConfigurations" API = "/deviceAppManagement/mobileAppConfigurations"
PreImportAssignmentsCommand = { Start-PreImportAssignmentsAppConfiguration @args } PreImportAssignmentsCommand = { Start-PreImportAssignmentsAppConfiguration @args }
PreFilesImportCommand = { Start-PreFilesImportAppConfiguration @args }
PostExportCommand = { Start-PostExportAppConfiguration @args }
Permissons=@("DeviceManagementConfiguration.ReadWrite.All") Permissons=@("DeviceManagementConfiguration.ReadWrite.All")
Icon="DeviceConfiguration" Icon="DeviceConfiguration"
Dependencies = @("Applications") Dependencies = @("Applications")
@@ -1961,7 +1964,134 @@ function Start-PostExportAppConfiguration
{ {
param($obj, $objectType, $path) param($obj, $objectType, $path)
Add-EMAssignmentsToExportFile $obj $objectType $path #Add-EMAssignmentsToExportFile $obj $objectType $path
Write-Log "Export app config for $($objectType.Id) with OData.Type: $($obj.'@OData.Type')"
if($obj.'@OData.Type' -eq "#microsoft.graph.androidManagedAppProtection" -or
$obj.'@OData.Type' -eq "#microsoft.graph.androidForWorkMobileAppConfiguration" -or
$obj.'@OData.Type' -eq "#microsoft.graph.androidManagedStoreAppConfiguration" -or
$obj.'@OData.Type' -eq "#microsoft.graph.iosMobileAppConfiguration")
{
$fileName = (Get-GraphObjectName $obj $objectType).Trim('.')
if((Get-SettingValue "AddIDToExportFile") -eq $true -and $obj.Id)
{
$fileName = ($fileName + "_" + $obj.Id)
}
$tmpObj = $null
$fileName = "$path\$((Remove-InvalidFileNameChars $fileName)).json"
if([IO.File]::Exists($fileName))
{
$tmpObj = Get-GraphObjectFromFile $fileName
}
else
{
Write-Log "File not found: $fileName. Could not add App names." 3
}
if(($tmpObj.targetedMobileApps | measure).Count -gt 0)
{
Write-Log "Add target apps info"
$targetedApps = @()
foreach($appId in $tmpObj.targetedMobileApps)
{
$appObj = Invoke-GraphRequest -Url "/deviceAppManagement/mobileApps/$($appId)" #?`select=id,displayName" -ODataMetadata "Minimal"
if($appObj)
{
Write-Log "Add target app info $($appObj.displayName) ($($appObj.Id)) of type $($appObj.'@OData.Type')"
$targetedApps += $appObj.displayName + '|!|' + $appObj.Id + '|!|' + $appObj.'@OData.Type'
}
}
if($targetedApps.Count -gt 0)
{
Write-Log "Add CustomRefTargetedApps property"
$tmpObj | Add-Member -MemberType NoteProperty -Name "#CustomRefTargetedApps" -Value ($targetedApps -join "|*|")
Write-Log "Save file $fileName"
Save-GraphObjectToFile $tmpObj $fileName
}
}
else
{
Write-Log "No target apps found" 2
}
}
}
function Start-PreFilesImportAppConfiguration
{
param($objectType, $filesToImport)
$targetedAppsObjects = $filesToImport | Where { $null -ne $_.Object."#CustomRefTargetedApps" }
if(($targetedAppsObjects | measure).Count -gt 0)
{
Write-Log "Policies with Targeted Apps detected"
foreach($fileObject in $targetedAppsObjects)
{
Add-AppConfigurationTargets $objectType $fileObject
}
}
$filesToImport
}
function local:Add-AppConfigurationTargets
{
param($obj, $fileObj)
if($fileObj.Object."#CustomRefTargetedApps" -and $fileObj.Object.targetedMobileApps)
{
Write-Log "Adding app target for $($fileObj.Object.displayName)"
$targetedAppsInfo = $fileObj.Object."#CustomRefTargetedApps"
$translatedTargetedApps = @()
if($targetedAppsInfo)
{
foreach($targetedApp in ($targetedAppsInfo -split "[|][*][|]"))
{
$appName, $appId, $appType = $targetedApp -split "[|][!][|]"
if(-not $appName -or -not $appId)
{
Write-Log "App Name and Id is missing in string: $appApp" 2
continue
}
$tmpApps = (Invoke-GraphRequest -Url "/deviceAppManagement/mobileApps?`$filter=displayName eq '$appName'").value
if(-not $tmpApps)
{
Write-Log "No application found with name $appName. $appId will not be translated and added to target list" 2
continue
}
Write-Log "Found $(($tmpApps | measure).Count) applications" 2
foreach ($tmpApp in $tmpApps) {
Write-Log "Found '$($tmpApp.displayName)' ($($tmpApp.id)) of type $($($tmpApp.'@OData.Type'))"
}
$tmpApp = $tmpApps | Where-Object '@OData.Type' -eq $appType
if(-not $tmpApp)
{
Write-Log "No $appName application found of type $appType. $appId will not be translated and added to target list" 2
}
elseif(($tmpApp | measure).Count -gt 1) {
Write-Log "$(($tmpApp | measure).Count) applications found with name '$appName' of type $appType. $appId will not be translated and added to target list" 2
}
else {
Write-Log "Found '$appName' with id $($tmpApp.Id) ($appType)"
$translatedTargetedApps += $tmpApp.Id
}
}
if($translatedTargetedApps.Count -gt 0) {
Write-Log "Updating translated targeted apps"
$fileObj.Object.targetedMobileApps = $translatedTargetedApps
}
else {
Write-Log "Could not find targeted apps in the evnironment. Verify that they are added. Policy import might fail" 3
}
}
}
} }
function Start-PreImportAssignmentsAppConfiguration function Start-PreImportAssignmentsAppConfiguration
@@ -2479,7 +2609,7 @@ function Start-PostFilesImportApplications
if(($refObjects | measure).Count -gt 0) if(($refObjects | measure).Count -gt 0)
{ {
Write-Log "Applicetions with Depnedency or Supersedence detected" Write-Log "Applicetions with Dependency or Supersedence detected"
foreach($file in $refObjects) foreach($file in $refObjects)
{ {
Add-ApplicationReferences $file.ImportedObject $file.Object Add-ApplicationReferences $file.ImportedObject $file.Object

View File

@@ -35,16 +35,29 @@ function Invoke-InitializeModule
Add-ViewObject $global:EMInfoViewObject Add-ViewObject $global:EMInfoViewObject
Add-ViewItem (New-Object PSObject -Property @{ Add-ViewItem (New-Object PSObject -Property @{
Title = "Baseline Templates" Title = "Baseline Templates - Intent"
Id = "BaselineTemplates" Id = "BaselineTemplates"
ViewID = "EMInfoGraphAPI" ViewID = "EMInfoGraphAPI"
API = "/deviceManagement/templates" API = "/deviceManagement/templates"
ShowButtons = @("Export","View") ShowButtons = @("Export","View")
Permissons=@("DeviceManagementConfiguration.ReadWrite.All") Permissons=@("DeviceManagementConfiguration.ReadWrite.All")
Icon="EndpointSecurity" Icon="EndpointSecurity"
ExpandAssignmentsList = $false ExpandAssignmentsList = $false
}) })
Add-ViewItem (New-Object PSObject -Property @{
Title = "Baseline Templates - Settings Catalog"
Id = "BaselineTemplatesSettingsCatalog"
ViewID = "EMInfoGraphAPI"
API = "/deviceManagement/configurationPolicyTemplates"
QUERYLIST = "`$filter=(templateFamily eq 'Baseline')"
ShowButtons = @("Export","View")
DefaultColumns = "0,displayName=Template Name,displayVersion=Version,lifecycleState=State,baseId=Template Id,id"
Permissons=@("DeviceManagementConfiguration.ReadWrite.All")
Icon="EndpointSecurity"
ExpandAssignmentsList = $false
})
Add-ViewItem (New-Object PSObject -Property @{ Add-ViewItem (New-Object PSObject -Property @{
Title = "Android Google Play" Title = "Android Google Play"
Id = "AndroidGooglePlay" Id = "AndroidGooglePlay"

View File

@@ -10,7 +10,7 @@ This module manages Authentication for the application with MSAL. It is also res
#> #>
function Get-ModuleVersion function Get-ModuleVersion
{ {
'3.9.7' '3.9.8a'
} }
$global:msalAuthenticator = $null $global:msalAuthenticator = $null
@@ -119,7 +119,15 @@ function Invoke-InitializeModule
Type = "Boolean" Type = "Boolean"
DefaultValue = $false DefaultValue = $false
Description = "Sort the list of cached accounts based on user name. Updated at restart or account change" Description = "Sort the list of cached accounts based on user name. Updated at restart or account change"
}) "MSAL" }) "MSAL"
Add-SettingsObject (New-Object PSObject -Property @{
Title = "Sort Tenant List"
Key = "SortTenantList"
Type = "Boolean"
DefaultValue = $false
Description = "Sort the list of available tenants based on Tenant name. Updated at restart or account change"
}) "MSAL"
Add-MSALPrereq Add-MSALPrereq
} }
@@ -1804,8 +1812,18 @@ function Get-MSALProfileEllipse
$lbObj = [Windows.Markup.XamlReader]::Parse("<TextBlock $wpfNS><Bold>Tenants:</Bold></TextBlock>") $lbObj = [Windows.Markup.XamlReader]::Parse("<TextBlock $wpfNS><Bold>Tenants:</Bold></TextBlock>")
$lbObj.Margin = "0,5,0,0" $lbObj.Margin = "0,5,0,0"
if((Get-SettingValue "SortTenantList") -eq $true)
{
$tenants = $script:AccessableTenants | Sort -Property DisplayName
}
else
{
$tenants = $script:AccessableTenants
}
Add-GridObject $otherLogins $lbObj Add-GridObject $otherLogins $lbObj
foreach($tenant in $script:AccessableTenants) foreach($tenant in $tenants)
{ {
try try
{ {

View File

@@ -10,7 +10,7 @@ This module manages Microsoft Grap fuctions like calling APIs, managing graph ob
#> #>
function Get-ModuleVersion function Get-ModuleVersion
{ {
'3.9.6' '3.9.8a'
} }
$global:MSGraphGlobalApps = @( $global:MSGraphGlobalApps = @(
@@ -804,7 +804,7 @@ function Show-GraphObjects
$tableColumns = @() $tableColumns = @()
$additionalColumns = @() $additionalColumns = @()
$additionalColsStr = Get-Setting "EndpointManager\ObjectColumns" "$($global:curObjectType.Id)" $additionalColsStr = ?? (Get-Setting "EndpointManager\ObjectColumns" "$($global:curObjectType.Id)") $global:curObjectType.DefaultColumns
if($additionalColsStr) if($additionalColsStr)
{ {
$additionalColumns += $additionalColsStr.Split(',') $additionalColumns += $additionalColsStr.Split(',')
@@ -2635,7 +2635,8 @@ function Add-GraphMigrationInfo
$objType = $objInfo."@odata.type" $objType = $objInfo."@odata.type"
if($objType -eq "#microsoft.graph.groupAssignmentTarget" -or if($objType -eq "#microsoft.graph.groupAssignmentTarget" -or
$objType -eq "#microsoft.graph.exclusionGroupAssignmentTarget") $objType -eq "#microsoft.graph.exclusionGroupAssignmentTarget" -or
$objType -eq "#microsoft.graph.cloudPcManagementGroupAssignmentTarget")
{ {
Add-GraphMigrationObject $objInfo.groupid "/groups" "Group" Add-GraphMigrationObject $objInfo.groupid "/groups" "Group"
} }
@@ -4169,7 +4170,7 @@ function local:Add-ObjectColumnInfoClass
function Local:Show-ObjectDefaultColumnsSettings function Local:Show-ObjectDefaultColumnsSettings
{ {
$strColSettings = Get-Setting "EndpointManager\ObjectColumns" "$($global:curObjectType.Id)" $strColSettings = ?? (Get-Setting "EndpointManager\ObjectColumns" "$($global:curObjectType.Id)") $global:curObjectType.DefaultColumns
$script:colObjectProperties.Clear() $script:colObjectProperties.Clear()
$defaultColumns = (?? $global:curObjectType.ViewProperties (@("displayName","description","id"))) $defaultColumns = (?? $global:curObjectType.ViewProperties (@("displayName","description","id")))
if($strColSettings) if($strColSettings)

View File

@@ -1,4 +1,51 @@
# Release Notes # Release Notes
## 3.9.8 - 2024-09-10
**New features**
- **Intune Info**<br />
- Added 'Baseline Templates - Settings Catalog'<br />
This list templates for Settings Catalog policies eg. Security Baseline for Windows 10 and later<br />
**Fixes**
- **Import/Export**<br />
- Fixed support for export/import App Configurations (Device) - Android between environments<br />
Based on [Issue 255](https://github.com/Micke-K/IntuneManagement/issues/255)<br />
Thank you @jimmywinberg for all the testing!<br />
- Fixed support for export/import App Configurations (Device) - iOS (VPP) between environments<br />
Based on [Issue 260](https://github.com/Micke-K/IntuneManagement/issues/260)<br />
Thank you @Arne-RFA for all the testing!<br />
- Added support for exporting Groups targeted in W365 assignments<br />
Based on [Issue 261](https://github.com/Micke-K/IntuneManagement/issues/261)<br />
- Added tooltip that variables are supported in the Export folder path<br />
Based on [Discussions 269](https://github.com/Micke-K/IntuneManagement/discussions/269)<br />
- **Documentation**<br />
- App Configuration (Device) documentation updated<br />
Added support for value type for Android policies<br />
Please continue discussion on the Issue below if this is still not working<br />
Based on [Issue 231](https://github.com/Micke-K/IntuneManagement/issues/231)<br />
This required some rewriting of the core documentation and an update to all output providers<br />
This will make it easier to add additional tables to the documentation in the future<br />
- Fixed issue with missing group name when exporting CSV<br />
Based on [Issue 274](https://github.com/Micke-K/IntuneManagement/issues/274)<br />
- Fixed issue with Authentication Strength when documenting Conditional Access policies<br />
- Language files re-generated<br />
- ObjectInfo files re-generated. Some Android updates<br />
- ObjectCategory file re-generated<br />
- **Compare**<br />
- Fixed issue with assignments on exported files when doing a Documentation compare<br />
The group name was not resolved from migration table file<br />
Based on [Issue 274](https://github.com/Micke-K/IntuneManagement/issues/274)<br />
- **Authentication**<br />
- Added setting to allow Sort Tenant List<br />
Based on [Issue 265](https://github.com/Micke-K/IntuneManagement/issues/265)<br />
<br />
## 3.9.7 - 2024-06-27 ## 3.9.7 - 2024-06-27
**New features** **New features**
@@ -29,7 +76,7 @@
- **Documentation**<br /> - **Documentation**<br />
- App Configuration (Device) documentation updated<br /> - App Configuration (Device) documentation updated<br />
Hopfully add support for Android. Not verified since I don't have one in my test environment<br /> Initial support for Android<br />
Please continue discussion on the Issue below if this is still not working<br /> Please continue discussion on the Issue below if this is still not working<br />
Based on [Issue 231](https://github.com/Micke-K/IntuneManagement/issues/231)<br /> Based on [Issue 231](https://github.com/Micke-K/IntuneManagement/issues/231)<br />
- Added support for documenting MacOS Custom attribute<br /> - Added support for documenting MacOS Custom attribute<br />

View File

@@ -21,7 +21,17 @@
<StackPanel Orientation="Horizontal" Margin="0,0,5,0" > <StackPanel Orientation="Horizontal" Margin="0,0,5,0" >
<Label Content="Export root" /> <Label Content="Export root" />
<Rectangle Style="{DynamicResource InfoIcon}" ToolTip="The root folder where exported files will be stored" /> <Rectangle Style="{DynamicResource InfoIcon}">
<Rectangle.ToolTip>
<TextBlock>
The root folder where exported files will be stored. Supported variables:<LineBreak />
<Bold>%Date%</Bold> Will be replaced by date in format: yyyy-MM-dd<LineBreak />
<Bold>%DateTime%</Bold> Will be replaced by date and time in format: yyyyMMdd-HHmm<LineBreak />
<Bold>%Organization%</Bold> Will be replaced with the Tenant name<LineBreak />
<Bold>Any environment variable</Bold> Replace with the value of the environment variable
</TextBlock>
</Rectangle.ToolTip>
</Rectangle>
</StackPanel> </StackPanel>
<Grid Grid.Column='1' Grid.Row='0'> <Grid Grid.Column='1' Grid.Row='0'>