I am trying to run a get-aduser command and | it into a set-aduser command, but how do I display the get-aduser command and also pipe it into the set-aduser?
Thanks
I am trying to run a get-aduser command and | it into a set-aduser command, but how do I display the get-aduser command and also pipe it into the set-aduser?
Thanks
Pipe the output of the Get-ADUser command to a scriptblock that displays it and also executes the Set-ADUser command:
Get-ADUser ... | ForEach-Object { $_ ; Set-ADUser $_ ... }
The first $_ displays the object returned by Get-ADUser; the second passes it to the Set-ADUser command.