I've looked into this one a bit further, and the problem is that the dial-up connections (e.g. Those listed in your Network Connections folder) are not interfaces in RRAS (as you found). The only dial-up interfaces available to RRAS are demand-dial interfaces (as seen in the RRAS MMC). This means that what you are doing is only possible on a server (2000 or 2003). If you are trying to do this on a server, then you should create the demand-dial interface using the RRAS console, you will then be able to use it in the script above.
Hi Cartman Shen, thank you for your reply. I have to install and configure RRAS NAT in OS windows 2012 because of project. Actually configuring RRAS NAT could be operated successfully by GUI, but I am finding a way to install and configuring RRAS NAT by script, the installment command such as:'install-windowsfeature' and the new interface command 'netsh routing ip nat add interface 'Ethernet 2.
I don't think it is possible to create a demand-dial interface using netsh, that part must be done through MMC. So, yes, I think you should create a demand-dial interface! Let me know how it goes!
Further note: It is theoretically possible to add a demand-dial interface via netsh, eg: netsh interface add interface 'My Dial-up Connection' full However, there must be a corresponding entry for 'My Dial-up Connection' in the phonebook of the computer. In practise (i.e. My tests on my server) I always get an error when executing the above (says system phonebook cannot be found, or access denied). Even if this method does work, the requirement for a phonebook entry means that the whole solution couldn't purely be achieved using netsh.