Can netdom be used remotely? It would be my preference to not rely on another tool, if I can accomplish the same thing with a few calls to WMI object methods.
As for the Rename() and JoinDomainOrWorkgroup() methods, I'm not familiar with setting up WbemLocator settings. First, I don't know whether to use SWbemLocator, or IWbemLocator, or how either would be called from within PowerShell. I mention this because apparently I have to have an elevated WMI connection to the computer I'm going to execute these methods against. Am I making sense? I hope so!
Tony