Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output System.Object #163

Closed
tinakane opened this issue Sep 24, 2020 · 2 comments
Closed

Output System.Object #163

tinakane opened this issue Sep 24, 2020 · 2 comments

Comments

@tinakane
Copy link

When I ran this against a domain with all Server 2016's the output was fine.

When I run this against another domain with a mix of 2016/2012 non R2 I get output at the bottom "System.Object" - since that isn't translated to a DC name is this bad output, an error in syntax or is this to be expected?

Example,

"DomainController","OperatingSystem","Update","Compliance"

"DC01","Microsoft Windows Server 2012 Datacenter","KB4571702","True"
"DC01","Microsoft Windows Server 2012 Datacenter","KB4577038","True"
"DC01","Microsoft Windows Server 2012 Datacenter","KB4571702","True"
"DC01","Microsoft Windows Server 2012 Datacenter","KB4577038","True"
"DC02","Microsoft Windows Server 2012 Datacenter","KB4571702","True"
"DC02","Microsoft Windows Server 2012 Datacenter","KB4577038","True"
"DC02,"Microsoft Windows Server 2012 Datacenter","KB4571702","True"
"DC02,"Microsoft Windows Server 2012 Datacenter","KB4577038","True"
"DC03","Microsoft Windows Server 2016 Standard","KB4571694","True"
"System.Object[]","System.Object[]","No KB Installed for CVE-2020-1472","False"
"System.Object[]","System.Object[]","No KB Installed for CVE-2020-1472","False"
"System.Object[]","System.Object[]","No KB Installed for CVE-2020-1472","False"
"System.Object[]","System.Object[]","No KB Installed for CVE-2020-1472","False"
"System.Object[]","System.Object[]","No KB Installed for CVE-2020-1472","False"
"System.Object[]","System.Object[]","No KB Installed for CVE-2020-1472","False"
"System.Object[]","System.Object[]","No KB Installed for CVE-2020-1472","False"
"System.Object[]","System.Object[]","No KB Installed for CVE-2020-1472","False"
"System.Object[]","System.Object[]","No KB Installed for CVE-2020-1472","False"

@technion
Copy link

At line 425:

    $compare | ForEach-Object {
        $DC = $compare.Inputobject

It's doing a "foreach" on the whole array, leading to every item being a System.Object[] to log. This specific issue can be fixed by changing 426 to:

        $DC = $_.Inputobject

But that that continues to log each server as having no KB installed directly after stating that it did. I don't believe Compare-Object has the semantics that it's being used for here.

@h-m-f-t
Copy link
Member

h-m-f-t commented Sep 30, 2020

Thanks for these comments. Check out the updated script (see #164).

@h-m-f-t h-m-f-t closed this as completed Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants