"PowerShell Core" 6.x "Remote Server Administration Tools" 1809 Get-* -Filter * Properties * broken
Get-AD Cmdlets broken when using "-Filter " and & or "-Properties *"
on Windows 10 1809 with Remote Server Administration Tools 1809:
Name : ConsoleHost
Version : 6.1.1
InstanceId : 376bfa55-d7c2-41ad-89dc-bc63b357ccb8
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
Get-ADobject -Server $Forest.DomainNamingMaster -Credential $Creds.$ForestKey -LDAPFilter "(objectClass=site)" -SearchBase 'CN=Configuration,DC=contoso,DC=com' -Properties *
Get-ADobject : Object reference not set to an instance of an object.
At line:1 char:1
+ Get-ADobject -Server $Forest.DomainNamingMaster -Credential $Creds.$F ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ADObject], NullReferenceException
+ FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.NullReferenceException,Microsoft.ActiveDirectory.Management.Commands.GetADObject
Same Windows 10 1809 system results with PoewrShell v.5.1.1.x
Get-ADobject -Server $Forest.DomainNamingMaster -Credential $Creds.$ForestKey -LDAPFilter "(
objectClass=site)" -SearchBase 'CN=Configuration,DC=contoso,DC=com' -Properties * | FT DisplayName,WhenCreated -AutoSize
DisplayName WhenCreated
5/13/2002 12:27:06 PM
3/6/2002 10:40:48 AM
11/19/2004 9:59:25 AM
7/12/2002 3:51:37 PM
...
*NOTE: Format-Table pipeline intentionally excluded under PowerShell Core 6.1.1.x example for clarity. DisplyName & Whencreated attributes used in PowerShell 5.1.1.x to protect live system data.

1 comment
-
Joe Patterson commented
Additional info on PowerShell 5.1:
Name : ConsoleHost
Version : 5.1.17763.134
InstanceId : 8330f32d-493d-4d35-986c-2d385b7d900b
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace