You are not logged in.
Hi all
I capture the console ouput of dcdiag with the following command:
$out = & dcdiag /test:VerifyEnterpriseReferences
Now, the $out contains a linebreak probably due to the console default screen buffer size width (80). The output looks like this
Doing primary tests
Testing server: Site1\DC1
Starting test: VerifyEnterpriseReferences
......................... DC1 passed test
VerifyEnterpriseReferences
instead of this
Doing primary tests
Testing server: Site1\DC1
Starting test: VerifyEnterpriseReferences
......................... DC1 passed test VerifyEnterpriseReferences
Parsing the output is the problem. Is there a way to capture the output before it is rendered by the console?
thanks a lot
Offline
Parsing problem example:
$out[32]
......................... ADSPS001 passed test
$out[34]
VerifyEnterpriseReferences
instead of
$out[32]
......................... ADSPS001 passed test VerifyEnterpriseReferences
Offline
The solution here would be to increase the console buffer width before executing the command. Thankfully, programmatically setting the console buffer size is easily done in PowerShell.
[Console]::BufferWidth = 4096
Offline
Sorry for my late respons, I was on Holiday. Thank you very much, I had the same workaround at the end. However, this only worked when I started a new PowerShell process, increasing the buffer size of the current "script process" had no effect on the output of dcdiag.
Offline
Sorry for my late respons, I was on Holiday. Thank you very much, I had the same workaround at the end. However, this only worked when I started a new PowerShell process, increasing the buffer size of the current "script process" had no effect on the output of dcdiag.
This could be because you are running DCDiag as an elevated process, so you will need to change the BufferWidth in the same elevated process.
Offline