bobsa32
Technical User
- Jan 19, 2006
- 168
Hi,
I am struggling with what should be an easy script, I need to map a user on a TS 2008 box to the connecting computers CD. The CD is shared and I can connect to it by running:
$net = $(New-Object -ComObject WScript.Network);
$net.MapNetworkDrive("e:", "\\PC\cd");
However, I want to do this automatically by using something like:
$net = $(New-Object -ComObject WScript.Network);
$net.MapNetworkDrive("e:", "\\%clientname%\cd");
Is there a %clientname% alternative in powershell that will work, or a better script?
Thanks in advance
I am struggling with what should be an easy script, I need to map a user on a TS 2008 box to the connecting computers CD. The CD is shared and I can connect to it by running:
$net = $(New-Object -ComObject WScript.Network);
$net.MapNetworkDrive("e:", "\\PC\cd");
However, I want to do this automatically by using something like:
$net = $(New-Object -ComObject WScript.Network);
$net.MapNetworkDrive("e:", "\\%clientname%\cd");
Is there a %clientname% alternative in powershell that will work, or a better script?
Thanks in advance