If all of the machines are set to use "ConstrainedLanguage" then they all should be rejecting the creation of a COM object.
Place function "Test-TypePermitted" into a PS script file: https://stackoverflow.com/questions/64805592/automatically-retrieve-allowed-types-for-constrained-language-mode
At the bottom of the script, place this code:
[__ComObject] | Test-TypePermitted -Mode Constrained
You should see this when you run that script:
TypeName Permitted Message
-------- --------- -------
System.__ComObject False Cannot create type. Only core types are supported in this language mode.
This bit of code should tell you the current language mode for the machine:
try {
$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
$Property = "__PSLockdownPolicy"
$result = Get-ItemProperty -Path $path -Name $Property
$PolicyValue = $result.__PSLockdownPolicy
$LockdownPolicy = switch ($PolicyValue) {
0 { "Full Language Mode"; Break }
1 { "Full Language Mode"; Break }
2 { "Full Language Mode"; Break }
3 { "Full Language Mode"; Break }
8 { "Full Language Mode"; Break }
4 { "Constrained Language Mode"; Break }
5 { "Constrained Language Mode"; Break }
6 { "Constrained Language Mode"; Break }
7 { "Constrained Language Mode"; Break }
}
Write-Host "Lockdown Policy Value: $PolicyValue - $LockdownPolicy" -ForegroundColor Yellow
}
Catch {
if ($result -eq $null) {
Write-Host = "No PSLockdownPolicy found. Should be operating in Full Lanaguge Mode" -ForegroundColor Yellow
}
}