mojoxp Posted May 31, 2006 Share Posted May 31, 2006 I've got a computer here that needs to go into a conference room and be logged in all the time. That's easy. The catch is that it needs to be able to access the central domain network share using a given users permissions from a desktop shortcut. That user needs to be able to quickly get access to their files and open them on the computer without logging directly into the machine. I've tried doing this with both RUNAS and CPAU, and they work but the problem is that they must copy over the user's profile in order to do so... which won't work for this situation. So what I need to figure out is how to have the user be able to click a link on the desktop and it will accept their credentials and then open the network share using those without having to load the profile over. Any ideas? Link to comment Share on other sites More sharing options...
Noise Posted May 31, 2006 Share Posted May 31, 2006 Sounds like you may be trying to overcomplicate things. I'm not 100% certain I understand what you want, but try the net use command to connect a drive letter...net use * \\server\share /user:domain\user password /persistent:noThis will map a drive from one system to another using the credentials specified. Link to comment Share on other sites More sharing options...
Mr Snrub Posted May 31, 2006 Share Posted May 31, 2006 Terminal Services session to a server that is a domain member?If the files are held on a Windows Server, use IIS & WebDAV to access the files through a browser, and use integrated Windows authentication? Link to comment Share on other sites More sharing options...
nitroshift Posted May 31, 2006 Share Posted May 31, 2006 didn't quite undersand your problem, but since you already shared the resource, isn't it easier to just set the permissions for that user and map the resource? Link to comment Share on other sites More sharing options...
mojoxp Posted May 31, 2006 Author Share Posted May 31, 2006 (edited) Basically what we have is the single user setup on the laptop that's always logged in, and then we need the user to be able to access this network share using their credentials while still logged in as that user. I think I've got a solution worked out... I have a VBS script that executes and opens up an IE window to get thier user name and password. It then opens up the network share, and opens up an IE window that has a button for them to click to log them out of the network share. Its a bit complicated, but its the only solution I could come up with. Here's the VBS Code:' COMMENT: Gets a user's login name, then executes a RUNAS on the command prompt ' that opens up Documents on Lexus with that user's credentials. For the' ' ' ' ' **********************************************************************************' Variable Declerations' **********************************************************************************On Error Resume NextDim WShell, strCommandSet WshShell = CreateObject("Wscript.Shell")' Open up Internet Exporer to get user inputSet objExplorer = WScript.CreateObject _ ("InternetExplorer.Application", "IE_")objExplorer.Navigate "file:///C:\Conference\Password.htm" objExplorer.ToolBar = 0objExplorer.StatusBar = 0objExplorer.Width = 400objExplorer.Height = 350 objExplorer.Left = 300objExplorer.Top = 200objExplorer.Visible = 1 ' Loop while waiting for IE to closeDo While (objExplorer.Document.Body.All.OKClicked.Value = "") Wscript.Sleep 250 Loop ' Take in the input from IEstrUsername = objExplorer.Document.Body.All.UserName.ValuestrPassword = objExplorer.Document.Body.All.UserPassword.ValuestrButton = objExplorer.Document.Body.All.OKClicked.ValueobjExplorer.QuitWscript.Sleep 250'Add the domain to the user namestrUsername = strUsername & "@<FQDN>"'If the user clicked cancel, then end the script, if not open the server shareIf strButton = "Cancelled" Then Wscript.QuitElse ' Setup the path to the server using the user's input credentials strCommand = "net use \\<server>\<share> " & strPassword & " /USER:" & strUsername ' Wscript.Echo strCommand WshShell.Run strCommand,0,True ' Open up an explorer window to the network share strCommand = "explorer.exe \\<server>\<share>\" ' Wscript.Echo strCommand WshShell.Run strCommand,3,True ' Open up Internet Exporer to get the user to logout Set objExplorer = WScript.CreateObject _ ("InternetExplorer.Application", "IE_") objExplorer.Navigate "file:///C:\Conference\Close.htm" objExplorer.ToolBar = 0 objExplorer.StatusBar = 0 objExplorer.Width = 400 objExplorer.Height = 350 objExplorer.Left = 300 objExplorer.Top = 200 objExplorer.Visible = 1 ' Loop while waiting for IE to close Do While (objExplorer.Document.Body.All.OKClicked.Value = "") Wscript.Sleep 250 Loop ' Log the user out of Lexus strCommand = "net use \\<server>\<share> /delete" ' Wscript.Echo strCommand WshShell.Run strCommand,0,TrueEnd IfHere's the first IE Window (Password.htm)Sub RunScript OKClicked.Value = "OK"End SubSub CancelScript OKClicked.Value = "Cancelled"End Sub</SCRIPT><BODY><font size="2" face="Arial">Username: </font><font face="Arial"><input type="InputBox" name="UserName" size="40"></font></p>Password: </font><font face="Arial"><input type="password" name="UserPassword" size="40"></font></p><input type="hidden" name="OKClicked" size = "20"><input id=runbutton class="button" type="button" value=" OK "name="ok_button" onClick="RunScript"> <input id=runbutton class="button" type="button" value="Cancel"name="cancel_button" onClick="CancelScript"></BODY>And here's the second (Close.htm)<script LANGUAGE="VBScript">Sub RunScript OKClicked.Value = "OK"End SubSub CancelScript OKClicked.Value = "Cancelled"End Sub</SCRIPT><BODY><font size="2" face="Arial">Click the button below to log out of the network share </font><input type="hidden" name="OKClicked" size = "20"><input id=runbutton class="button" type="button" value=" OK "name="ok_button" onClick="RunScript"></BODY> Edited May 31, 2006 by mojoxp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now