I recently did some work with netsh so can offer these command samples:
I don't think that netsh can change the workgroup name but you can use the NetJoinDomain function.
/* Sets the DNS servers. */
netsh interface ip set dns name="Local Area Connection" source=static addr=10.0.0.1
netsh interface ip add dns name="Local Area Connection" addr=10.0.0.2
/* Sets the IP address. */
netsh interface ip set address name="Local Area Connection" addr=10.0.0.9 mask=255.255.255.0 gateway=10.0.0.1
Alternatively, these tasks can be performed using WMI with the Win32_NetworkAdapterConfiguration and Win32_ComputerSystem classes.