Thursday, August 31, 2017

Powershell Redirection of output

Was needing to send error output from a command to the logfile.
Ran across these two articles that helped me.


Powershell Move-Item logging
You may just need to collapse the output file descriptors. According to the about_Redirection page, it should work if you do the following:
Move-Item c:\temp\*.* C:\Temp\2014 -Verbose -Force *>&1 | 
    Out-File -FilePath $MyLogPath
Or if you want to see the output at the same time
Move-Item c:\temp\*.* C:\Temp\2014 -Verbose -Force *>&1 |
    Tee-File -FilePath $MyLogPath





SMB Share in Failover Cluster - Server 2012R2

Ran into a problem with creating a SMB Transparent Failover share on our Server 2012R2 cluster.   It kept giving the error - “The request is not supported” and looking at the Event Log: Microsoft-Windows-SmbServer/Operational, there was the error: CA failure – Failed to set continuously available property on a new or existing file share as Resume Key filter is not started.


After some research, ran across the article from https://blog.workinghardinit.work: https://blog.workinghardinit.work/2012/09/28/continuously-available-file-shares-in-dont-support-short-file-names-the-request-is-not-supported-ca-failure-failed-to-set-continuously-available-property-on-a-new-o/




Followed the steps, essentially removing 8.3 filename support from my volumes.  These volumes were created on Server 2008R2 and apparently 8.3 filename support was enabled by default.  Server 2012 Failover clusters do not support 8.3 filenames or having the property enabled.


fsutil 8dot3name set 2
  • The registry state is now: 2 (Per volume setting – the default).
fsutil 8dot3name set f: 1  
  • Successfully disabled 8dot3name generation on f:
fsutil 8dot3name strip f:
  • Remove any short file names present on this volume
Failover to each node and run these commands.