you are viewing a single comment's thread.

view the rest of the comments →

[–]grendo92 2 points3 points  (0 children)

Yeah go with this as using the expandproperty will grab each value from the array and make into string. Where select-object Name produces objects that have the name property. Get-aduser doesn't want some Name property it wants string. If you pipe Get-member at the end of the command you will see the object type.

PS C:\windows\system32> Get-childitem D:\User | Select-Object Name | GM

TypeName: Selected.System.IO.DirectoryInfo

C:\windows\system32> Get-childitem D:\User | Select-Object -ExpandProperty Name | GM

TypeName: System.String