Why Transcript cmdlet do not work on all Windows Server 2012 R2 the same way ?

hi Everyone,

I'm facing a problem that i've never seen before with the start-transcript cmdlet. Let me explain what is happening...

I have two Windows Server 2012 R2 Standard installed. One is for dev and the other one is for production environment. They boss have policyexecution set to Remotesign.

On my production server, i open a new powershell Windows and write :

start-transcript C:\PS1\test1.txt

write-host "hello world"

stop-transcript

Then, the transcript file output looks like this :

**********************
Windows PowerShell transcript start
Start time: ------
Username  : ------
Machine   : ------ (Microsoft Windows NT 6.3.9600.0)
**********************
Transcript started, output file is C:\PS1\test1.txt
PS C:\Users\Administrator.mydomain> write-host "hello world"
hello world
PS C:\Users\Administrator.mydomain> stop-transcript
**********************
Windows PowerShell transcript end
End time: ------
**********************

Which is normal. But if i put the same commands in a test2.ps1 script and launch it from the same powershell window the result is different and the output file transcript looks like this :

**********************
Windows PowerShell transcript start
Start time: ------
Username  : ------
Machine   : ------ (Microsoft Windows NT 6.3.9600.0)
**********************

**********************
Windows PowerShell transcript end
End time: ------
**********************

So it seems that the transcript cmdlet do not catch anything. What is unbelievable is that my dev server do not have this problem and the transcript output always have the same result in both case : showing the hello world etc.

Does anyone has never face this problem ? What is going wrong with this server ? Is there any security parameter that i have to set on my production server to make the start-transcript work normally in both case ?

Thank you for your help.

May 21st, 2015 5:52am

Write-host is not supported with transcripts except when typed at the console. 

Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 6:05am

If so, why does it work on my other Windows server ? I've try on an other 2012 R2 standard and on a 2008 R2. Both work and show hello world in the trancript output. all my powershell script are developped with the transcript to generate log and it hase always been working. this is the first server that i'm having a problem.
May 21st, 2015 6:13am

What versions of PowerShell?

Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 6:16am

on the two Windows Server 2012 R2, it's powershell V4...and on the Windows server 2008 R2 it's v2
May 21st, 2015 7:13am

on the two Windows Server 2012 R2, it's powershell V4...and on the Windows server 2008 R2 it's v2

And V4 on 2012 fails or behaves differently.  This is a known feature of V4 on 2012R2.

Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 7:25am

Sorry i don't understand what you just wrote.

As explain earlier : i use V4 on two Windows Server 2012 R2 standard servers...but i don't have the same results : one everythink works, the other it fails.

What can bring this behavior ?

May 21st, 2015 7:59am

What does "everything works" and "everything fails mean?

I asked what versions of PowerShell you were using and you told me they were different.  DO you have all of the updates to the framework? 

I cannot see your systems or guess what you have. 

Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 8:06am

Sorry if i m not clear. So i repeat.

Works on :

  • Powershell v2 on a prod Windows Server 2008 R2
  • Powershell V4 on a dev Windows Server 2012 R2

Not working on :

  • Powershell V4 on a prod Windows Server 2012 R2

I will check the Framework updates.

May 21st, 2015 9:11am

Check all version information with $PSVersionTable

There is a Net test utility you can download and run.

Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 9:27am

I don't have access right now to my PROD serveur. I will check this as soon as possible.

Below is what i get on my DEV server (on which everything is ok)

Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.34014
BuildVersion                   6.3.9600.16394
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

May 21st, 2015 10:15am

Below is the result on my production server (for which it doesn't work) :

Name                           Value                                                                                                                 
----                           -----                                                                                                                 
PSVersion                      4.0                                                                                                                   
WSManStackVersion              3.0                                                                                                                   
SerializationVersion           1.1.0.1                                                                                                               
CLRVersion                     4.0.30319.34014                                                                                                       
BuildVersion                   6.3.9600.17400                                                                                                        
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}                                                                                                  
PSRemotingProtocolVersion      2.2 

Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2015 3:42am

The two servers are definitely different.  The build numbers are different.

Are both servers the same version or is one a DataCenter or Enterprise and the other Standard.

May 22nd, 2015 3:47am

Both are identifyed as 2012 R2 Standard. Both are virtual machines.
May 22nd, 2015 4:00am

Thank you for this link. It seems to be the same problem that i encounter. They sayd it's a known bug from Microsoft on the last build version ? Is that right ?

What do you think i should do :

  • wait for bug fix if it's not out yet  ?
  • replace my write-host by write-output and rewrite all my powershell script ?

Thank you for your help again !

Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2015 4:10am

All of that was covered in the link and its related links. Please read all of the posts.

May 22nd, 2015 11:25am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics