The task is to first scan the local machine for a Valid Computer name (which I've done) then with that Computer name it should check a CSV to pipe the Username and Password sections somewhere.
My CSV reads as follows:
COMPUTERNAME1,USERNAME1,PASSWORD1
COMPUTERNAME2,USERNAME2,PASSWORD2
COMPUTERNAME3,USERNAME3,PASSWORD3
So if, for example, the VBS detects the computer name using the VBS:
Set wshShell = CreateObject( "WScript.Shell" )
strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
..And it detects the computer name is called: COMPUTERNAME2
Then the VBS should then look up that declared "strComputerName"
in the CSV (which is "COMPUTERNAME2"
) and pipe the associated next two lines for USERNAME2
,PASSWORD2
which I can then pipe again to an autologin script (which I have) so Autologin will associate that Computer Name to the Username and Password.
The objective is we're running an active CSV so the list of machines will grow so the key is just detect for the appropriate computer name.