Good Afternoon All,
I’m a complete newbee to powershell trying to get information into a string variable.
The String looks like this.
$LD = Get-ADUser -Filter {name -eq $SelectUser}|Select-Object -Property DistinguishedName|ft -AutoSize
What I’m trying to do is to store the output (currently being written to the screen) the the variable $LD
I know that the command;
Get-ADUser -Filter {name -eq $SelectUser}|Select-Object -Property DistinguishedName|ft -AutoSize
returns what I want, but cant seem to get the results into a string/
But all I get is Microsoft.PowerShell.Commands.Internal.Format.FormatStartData Microsoft.PowerShell.Commands.Internal.Format.GroupStartData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.GroupEndData Microsoft.PowerShell.Commands.Internal.Format.FormatEndData"
What do I need to do here please?
I’m a little lost!
With thanks