Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Move-ADObjects cmdlet: how do I log output?

$
0
0

Hello all,

I cannot get this cmdlet to log any output.  In the help file it does say the following:

PassThru

Returns the new or modified object. By default (i.e. if -PassThru is not specified), this cmdlet does not generate any output.

I'm not exactly sure what I'm doing wrong as I've specified this option and I still cannot log any output.  I've tried all the following variations:

Move-ADObject -Identity $ADObject.dn -TargetPath $OU -PassThru >> $logfile

Move-ADObject -Identity $ADObject.dn -TargetPath $OU -PassThru | Tee-Object -file $logfile -append

I've also tried these without the -passthru parameter.  Move-ADObject does display output on screen but I want to log this output.  I was able to log it with Start-Transcription, however, the output from this command is ugly.  It put all output on one line...  very unreadable.  Does anyone have any advice?  

Thanks!


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>