xmlpowershellgpo

GPO report missing data using XML


I was looking for 'Network access: Allow anonymous SID/Name translation' in XML output and it isn't in the file but it exists in HTML version. Is there a work around?

Get-GPOReport -All -ReportType xml -Path .\master.xml 
$master = Get-Content .\master.xml
$master -match 'transla'
          <q1:Name>Use online translation dictionaries</q1:Name>
          <q1:Explain>This policy setting allows you to prevent online dictionaries from being used for the translation of text through 
the Research pane.
If you enable or do not configure this policy setting, the online dictionaries can be used to translate text through the Research pane.
If you disable this policy setting, the online dictionaries cannot be used to translate text through the Research pane.</q1:Explain>

I get multiple results when using HTML

Get-GPOReport -All -ReportType html -Path .\master.html
$masterHTML = Get-Content .\master.html
$masterHTML -match 'transla'

<tr><td>Network access: Allow anonymous SID/Name translation</td><td>Disabled</td></tr>
<tr><td>Network access: Allow anonymous SID/Name translation</td><td>Disabled</td></tr>
<tr><td>Network access: Allow anonymous SID/Name translation</td><td>Disabled</td></tr>
<tr><td>Network access: Allow anonymous SID/Name translation</td><td>Disabled</td></tr>
<tr><td><span class="explainlink" tabindex="0" onkeypress="javascript:showExplainText(this); return false;" onclick="javascript:showExpl
ainText(this); return false;" gpmc_settingName="Use online translation dictionaries" gpmc_settingPath="User Configuration/Administrative
 Templates/Microsoft Word 2016/Miscellaneous" gpmc_settingDescription="This policy setting allows you to prevent online dictionaries fro
m being used for the translation of text through the Research pane.&lt;br/&gt;&lt;br/&gt;If you enable or do not configure this policy s
etting, the online dictionaries can be used to translate text through the Research pane.&lt;br/&gt;&lt;br/&gt;If you disable this policy
 setting, the online dictionaries cannot be used to translate text through the Research pane." gpmc_supported="At least Windows Server 2
008 R2 or Windows 7">Use online translation dictionaries</span></td><td>Disabled</td><td></td></tr>
<tr><td>Network access: Allow anonymous SID/Name translation</td><td>Disabled</td></tr>
<tr><td>Network access: Allow anonymous SID/Name translation</td><td>Disabled</td></tr>
<tr><td>Network access: Allow anonymous SID/Name translation</td><td>Disabled</td></tr>

Solution

  • You'll find 'Network access: Allow anonymous SID/Name translation' named as LSAAnonymousNameLookup, so try

    [xml]$gpor = Get-GPOReport -Name "My Group Policy Object" -ReportType Xml
    $gpor.GPO.Computer.ExtensionData.Extension.SecurityOptions | Where-Object { $_.SystemAccessPolicyName -eq 'LSAAnonymousNameLookup' }