I'm attempting to write a script below using New-Item cmdlet but apparently it does not like the DOS / Console (MSTSC.exe /v:SERVERNAME) paramenter being passed in.
Does anyone know of a Cmdlet that will allow me to loop through a serverlist and execute Remote Desktop Connection, i.e. open up as many RDC dialog boxes as I need to?
Thanks for you help Experts,
$a = Get-Content "c:\PowerShell Scripts\Servers.txt"
for ($i = 0; $i -lt $a.Length; $i++)
Invoke-Item $env:systemroot\system32\mstsc.exe /v:$a[$i]