
' read the CSV file, and parse the entries into the MMC session ObjShell.Run "c:\windows\system32\tsmmc.msc"

' copy the blank template file over the working file Set objTextFile = objFSO.OpenTextFile (strTemplate, ForReading) Set objFileCopy = objFSO.GetFile(strBlankMMC) StrTemplate = "c:\Projects\SortTsmmc\tsmmc.csv" StrWorkingMMC = "c:\windows\system32\tsmmc.msc" StrBlankMMC = "c:\Projects\SortTsmmc\blanktsmmc.msc" Set objDictionary = CreateObject("Scripting.Dictionary") Set objFSO = CreateObject("Scripting.FileSystemObject") Set objShell = CreateObject("WScript.Shell") ' Updated by Brian Travis, adding login and drive infoĭim objShell, objFSO, objFileCopy, objDictionary, objTextFileĭim strBlankMMC, strWorkingMMC, strTemplate, strNextLine ' Script to re-create tsmmc entries in order If you like this, I could use some Karma! ' CreateTSMMC.vbs If you make improvements, please share.Īnd I'm new here. Script is utilitarian, designed for speed of coding, not elegance. Of course, you'll need to have the Windows Admin Pak loaded. The script wants it called blanktsmmc.msc in c:\Projects\SortMmc. Open MMC and add a Remote Desktops snap-in. You can modify it to do pretty much anything you need.įirst, though, you need to start out with a blank tsmmc.msc file. I like to share drives, so this script checks that box. Oh, and this probably won't work on Vista or Windows 7 as the SendKeys method has been disabled for security purposes. You might need to tweak the delays on your system.

If someone can figure out how to change the name, please let me know.įor now, this seems to work, and allows re-building any time you need to add a server. Some-name is not used each section is named Remote Desktops. You can also add a line to break things up into separate ad-ins using the syntax: You'll have to sort this the way you want it. Server-name-or-ip,description,userid,domain I've modified it a bit to add structure and login information. So I found a script from Brett Clarke at. Looks like the msc file has an encrypted area that is just not accessible.
