---
title: "Discussion on \"Get a better Intune policy report part 3. (FINAL)\" | Hashnode"
description: "Discussion on \"Get a better Intune policy report part 3. (FINAL)\". By combining information from MDMDiagReport.xml and system registry"
url: "https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Get a better Intune policy report part 3. (FINAL)](https://doitpshway.com/get-a-better-intune-policy-report-part-3-final?utm_source=hashnode&utm_medium=feed)

By combining information from MDMDiagReport.xml and system registry

Nov 11, 2021 · 4 min read · doitpshway.com  
Updated Oct 12, 2022  
Read the article

-   [#powershell](https://hashnode.com/tag/powershell)
-   [#windows](https://hashnode.com/tag/windows)
-   [#script](https://hashnode.com/tag/script)
-   [#management](https://hashnode.com/tag/management)
-   [#html](https://hashnode.com/tag/html)

## Written by

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

@AndrewZtrhgf · Czech Republic

  
[View profile](https://hashnode.com/@AndrewZtrhgf)

System Administrator that loves PowerShell

I work as System Administrator for more than 15 years now and I love to make my life easier by automating work &amp; personal stuff via PowerShell (even silly things like food recipes list generation).

## Responses 3

Markdown supported · ⌘↵ to post

[komradekristoph](https://hashnode.com/@komradekristoph)

[Jan 25, 2024](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/65b2521420f9b6ba624e8c56)

This is fantastic, just found it and it's going to be very useful! Thank you so much.

One question, after the HTML has been produced I've noticed there are sections that seem to be skewed and there's no scroll bar on them to see the data on the right. Am I doing some wrong?

I used the following command: Get-ClientIntunePolicyResult -asHTML

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Jan 25, 2024](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/65b2521420f9b6ba624e8c56#reply-65b25507a975119a212051e2)

Don't have this problem so hard to say, can you DM me on twitter ([Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf) with some screenshots? Btw have you tried to zoom out (CTRL -) if that helps?

[komradekristoph](https://hashnode.com/@komradekristoph)

[Jan 25, 2024](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/65b2521420f9b6ba624e8c56#reply-65b25702e261065996069337)

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf) Well, that's embarrassing lol for some reason all browsers I tried skewed the view. Adjusting the zoom in and out made it display correctly. Thank you so much for the quick reply.

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Jan 25, 2024](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/65b2521420f9b6ba624e8c56#reply-65b257a7ffb7ad91465bfece)

[komradekristoph](https://hashnode.com/@komradekristoph) np :)

[Jony Doe](https://hashnode.com/@TrxRx)

[Aug 4, 2022](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/62ebcb5bcbce7c268014d8c6)

Hey, nice work but your Module needs some polish and errorhandling. To fullfill the requirements you need to install "AzureRM.profile" and RSAT (for ActiveDirectory Cmdlets). After that you kind of getting a report but it's missing some stuff.

I am also hanging at the point of [Jamie Holmes](https://hashnode.com/@stealthgeekjim) with the ConvertFrom-XML cmdlet. In Addition I am also getting this errors (German UI Language) after adding PoshFunctions to accomplish the ConvertFrom-XML requirement (without PoshFunctions the cmdlet is just unknown)

```
ConvertFrom-XML : Die Argumenttransformation für den Parameter "XML" kann nicht verarbeitet werden. Der Wert "System.Xml.XmlElement" kann nicht in den Typ "System.Xml.XmlDocument" konvertiert werden. Fehler: "Der angegebene Knoten 
konnte nicht als gültiger untergeordneter Knoten eingefügt werden, da der angegebene Knoten den falschen Typ hat."
In C:\Program Files\WindowsPowerShell\Modules\IntuneStuff\1.0.5\IntuneStuff.psm1:857 Zeichen:131
+ ... eDesktopAppManagementinfo.MsiInstallations | % { ConvertFrom-XML $_ }
+                                                                      ~~
    + CategoryInfo          : InvalidData: (:) [ConvertFrom-XML], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,ConvertFrom-XML

Get-ItemPropertyValue : Die Eigenschaft LastUpdatedTimeUtc ist im Pfad HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IntuneManagementExtension\Win32Apps\00000000-0000-0000-0000-000000000000\GRS nicht vorhanden.
In C:\Program Files\WindowsPowerShell\Modules\IntuneStuff\1.0.5\IntuneStuff.psm1:1469 Zeichen:39
+ ... edTimeUtc = Get-ItemPropertyValue $newestWin32AppRecord.PSPath -Name  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-ItemPropertyValue], PSArgumentException
    + FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.GetItemPropertyValueCommand

Get-ItemPropertyValue : Die Eigenschaft LastUpdatedTimeUtc ist im Pfad HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IntuneManagementExtension\Win32Apps\f88474cf-0063-42e2-b7d2-f0d342f3ce5f\GRS nicht vorhanden.
In C:\Program Files\WindowsPowerShell\Modules\IntuneStuff\1.0.5\IntuneStuff.psm1:1469 Zeichen:39
+ ... edTimeUtc = Get-ItemPropertyValue $newestWin32AppRecord.PSPath -Name  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-ItemPropertyValue], PSArgumentException
    + FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.GetItemPropertyValueCommand

Fehler beim Aufrufen der Methode, da [System.Management.Automation.PSObject] keine Methode mit dem Namen "op_Addition" enthält.
In C:\Program Files\WindowsPowerShell\Modules\IntuneStuff\1.0.5\IntuneStuff.psm1:1633 Zeichen:9
+         $intuneXMLReport += New-Object -TypeName PSObject -Property $ ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (op_Addition:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound
```

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Aug 4, 2022](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/62ebcb5bcbce7c268014d8c6#reply-62ec431df583cc2636e54720)

[Jony Doe](https://hashnode.com/@TrxRx)

I see.

This GRS registry key is relatively new thing. I will fix it tomorrow. (for now you can edit the function so it doesn't end there and continue instead)

According the active directory module. If you import it in ps console, does it show same error too? Anyway this error isn't related to my function. I saw it in past and solution was to explicitly select DC in the AD cmdlets (I think)

[Jony Doe](https://hashnode.com/@TrxRx)

[Aug 4, 2022](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/62ebcb5bcbce7c268014d8c6#reply-62ec4575f583cc2636e54743)

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf) Great work. I edited my previous comment with some details and little feature request. It would be great if you find the time to implement it. Thanks a lot :)

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Aug 5, 2022](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/62ebcb5bcbce7c268014d8c6#reply-62ecc85de3a3793580dfc543)

[Jony Doe](https://hashnode.com/@TrxRx)

GRS errors are fixed now. Thanks for reporting all the errors 👍

According to the feature requests:

-   clickable hrefs: I am using PSWriteHTML module (New-HTMLTable command) to generate the HTML and I don't think this is possible because it takes the input as plain text (and not as HTML code)
    
-   policy names: I have to look into this, but no promises because I don't have much time right now
    

[Jamie Holmes](https://hashnode.com/@stealthgeekjim)

[Jul 11, 2022](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/62cc0056222e2fa74e9bc8cb)

Hi, Im getting a fair few errors returned when I run this and I end up with an almost empty report, seems like it is having trouble converting from the xml:

PS C:\\WINDOWS\\system32> Get-ClientIntunePolicyResult -asHTML -showConnectionData -getDataFromIntune -Verbose -showURLs VERBOSE: Getting Intune data VERBOSE: Getting client Intune data via ConvertFrom-MDMDiagReportXML VERBOSE: Generating 'C:\\Users\\Public\\Documents\\MDMDiagnostics\\MDMDiagReport.xml'... VERBOSE: Converting 'C:\\Users\\Public\\Documents\\MDMDiagnostics\\MDMDiagReport.xml' to XML object VERBOSE: Getting EnrollmentID VERBOSE: Your EnrollmentID is 2380BB6B-9341-4A61-9662-371E30037C06 VERBOSE: Getting connection data VERBOSE: Getting Enrollments (MDMEnterpriseDiagnosticsReport.Resources.Enrollment) ConvertFrom-XML : Cannot process argument transformation on parameter 'XML'. Cannot convert value "System.Xml.XmlElement" to type "System.Xml.XmlDocument". Error: "The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type." At C:\\Program Files\\WindowsPowerShell\\Modules\\IntuneStuff\\1.0.4\\IntuneStuff.psm1:484 char:98

-   ... riseDiagnosticsReport.Resources.Enrollment | % { ConvertFrom-XML $\_ }
-   ~~
    -   CategoryInfo : InvalidData: (:) \[ConvertFrom-XML\], ParameterBindingArgumentTransformationException
    -   FullyQualifiedErrorId : ParameterArgumentTransformationError,ConvertFrom-XML

ConvertFrom-XML : Cannot process argument transformation on parameter 'XML'. Cannot convert value "System.Xml.XmlElement" to type "System.Xml.XmlDocument". Error: "The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type." At C:\\Program Files\\WindowsPowerShell\\Modules\\IntuneStuff\\1.0.4\\IntuneStuff.psm1:484 char:98

-   ... riseDiagnosticsReport.Resources.Enrollment | % { ConvertFrom-XML $\_ }
-   ~~
    -   CategoryInfo : InvalidData: (:) \[ConvertFrom-XML\], ParameterBindingArgumentTransformationException
    -   FullyQualifiedErrorId : ParameterArgumentTransformationError,ConvertFrom-XML

VERBOSE: Getting Policies (MDMEnterpriseDiagnosticsReport.PolicyManager.ConfigSource) ConvertFrom-XML : Cannot process argument transformation on parameter 'XML'. Cannot convert value "System.Xml.XmlElement" to type "System.Xml.XmlDocument". Error: "The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type." At C:\\Program Files\\WindowsPowerShell\\Modules\\IntuneStuff\\1.0.4\\IntuneStuff.psm1:638 char:107

-   ... agnosticsReport.PolicyManager.ConfigSource | % { ConvertFrom-XML $\_ }
-   ~~
    -   CategoryInfo : InvalidData: (:) \[ConvertFrom-XML\], ParameterBindingArgumentTransformationException
    -   FullyQualifiedErrorId : ParameterArgumentTransformationError,ConvertFrom-XML

ConvertFrom-XML : Cannot process argument transformation on parameter 'XML'. Cannot convert value "System.Xml.XmlElement" to type "System.Xml.XmlDocument". Error: "The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type." At C:\\Program Files\\WindowsPowerShell\\Modules\\IntuneStuff\\1.0.4\\IntuneStuff.psm1:638 char:107

-   ... agnosticsReport.PolicyManager.ConfigSource | % { ConvertFrom-XML $\_ }
-   ~~
    -   CategoryInfo : InvalidData: (:) \[ConvertFrom-XML\], ParameterBindingArgumentTransformationException
    -   FullyQualifiedErrorId : ParameterArgumentTransformationError,ConvertFrom-XML

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Jul 11, 2022](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/62cc0056222e2fa74e9bc8cb#reply-62cc0544bffc4694f5bc729e)

Will check this today. Thanks for feedback 👍

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Jul 11, 2022](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/62cc0056222e2fa74e9bc8cb#reply-62cc08f6222e2fa74e9bcb07)

I am afraid I will need to see your XML Intune report file. Please DM on Twitter [Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Ondrej Sebela](https://hashnode.com/@AndrewZtrhgf)

[Aug 4, 2022](https://hashnode.com/posts/get-a-better-intune-policy-report-part-3-final/618ce1a2f991b025366e2501/comment/62cc0056222e2fa74e9bc8cb#reply-62ec3252f583cc2636e5456a)

It should be fixed in the new version of the InstuneStuff module. Run Install-Module IntuneStuff to get it 👍
