I know how to set up logging to write to a remote location in the general case - just specify the output filename using the full UNC path (e.g. \\HOST-PC\directory\logoutput.etl) when creating the log job. However, a problem arises when new Virtual Machines are created from a master VM where logging has been enabled: each VM will be writing logs to the exact same file on the network. I need to find a way that each new VM will automatically write to a remote file unique to it.
I've tried using the %ComputerName% environment variable in the UNC path when setting up the log using logman.exe (e.g. \host\directory\%ComputerName%\log.etl) hoping that each VM would automatically expand this to include its unique name, but this doesn't work - you just get a folder named "%ComputerName%", without the variable being expanded. This is despite the fact that if you use e.g. %SystemRoot%, this does get expanded correctly (though of course this would create an invalid path in this instance). I'm not sure what causes some variables to be expanded and not others.
Any better ideas?