microsoft / Microsoft-Defender-for-Identity

Additional resources to improve customer experience with Microsoft Defender for Identity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'Must specify an object' on piping variable to Get-Member

LijuV-MSFT opened this issue · comments

The HTML report is being generated successfully, but getting this error with JSON object:

PS C:\Temp\Test-MdiReadiness> .\Test-MdiReadiness.ps1 -Verbose
VERBOSE: Performing the operation "Create MDI related configuration reports" on target "SFS.COM".
VERBOSE: Searching for Domain Controllers in SFS.COM
VERBOSE: Found 1 Domain Controller(s)
VERBOSE: Testing server requirements for SFSDC01.SFS.com
VERBOSE: Testing power settings for SFSDC01.SFS.com
VERBOSE: Testing advanced auditing for SFSDC01.SFS.com
VERBOSE: Testing NTLM auditing for SFSDC01.SFS.com
VERBOSE: Testing certificates readiness for SFSDC01.SFS.com
VERBOSE: Testing MDI sensor for SFSDC01.SFS.com
VERBOSE: Testing capturing component for SFSDC01.SFS.com
VERBOSE: Getting virtualization platform for SFSDC01.SFS.com
VERBOSE: Getting Operating System for SFSDC01.SFS.com
VERBOSE: Searching for CA servers in SFS.COM
VERBOSE: Cannot validate argument on parameter 'Identity'. The argument is null or an element of the argument
collection contains a null value.
VERBOSE: Found 0 CA server(s)
VERBOSE: Getting MDI related ADFS auditing configuration
VERBOSE: Getting MDI related DS Object auditing configuration
VERBOSE: Getting MDI related Exchange auditing configuration
VERBOSE: Getting AD Schema Version
VERBOSE: Creating detailed json report: .\mdi-SFS.COM.json
Get-Member : You must specify an object for the Get-Member cmdlet.
At C:\Temp\Test-MdiReadiness\Test-MdiReadiness.ps1:887 char:69
+ ... list] @($ReportData.CAServers | Get-Member -MemberType NoteProperty |
+                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

You cannot call a method on a null-valued expression.
At C:\Temp\Test-MdiReadiness\Test-MdiReadiness.ps1:889 char:5
+     $properties.Insert(0, 'FQDN')
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Temp\Test-MdiReadiness\Test-MdiReadiness.ps1:891 char:5
+     [void] $properties.AddRange($propsToAdd)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

VERBOSE: Creating html report: .\mdi-SFS.COM.html

Fixed bug when no CA servers or no Cert Publishers group in the domain.