Solved

Shortcuts that prompt for Domain Authenication

Posted on 2013-01-09
5
601 Views
Last Modified: 2013-01-14
We have a conference room PC that is setup to auto logon with a generic user account.  We want to create shortcuts to a number of network shared folders that will prompt for User name and password.  The generic account is not to have access to the folders itself.  We want the users to be able to click on the shortcuts and put their credentials in to access the data.  Also we would like it so that when the folder is closed and opened again it prompts for credentials each time as this machine will not likely be rebooted very often.  The Conference room PC is currently running Windows XP Pro.  How can this be accomplished?
0
Comment
Question by:dxwieland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 18

Expert Comment

by:Andrew Davis
ID: 38761523
You would need to write a vbs script that calls for the username and password and then opens the relevent folder with those credentials. But i feel this is frought with issues.

Why not just get users to log on to the system with their own accounts?



Cheers
Andrew
0
 

Author Comment

by:dxwieland
ID: 38763455
Andrew,

Can you provide a sample vbs script that i could work from?  Unfortunately as i agree it would just be better to have each user just log on with their own accounts which is how they are doing it now.  The business unit has asked for an auto logged on user account because the site is a remote construction site and it takes much too long for their profiles to load each time they log off and back on.  Also this machine is being used by multiple people in a meeting environment and a number of people may take control to show their piece and it is not practical for users to log off and back on for each presenter.  I hope this makes sense.

Thanks

Daniel
0
 
LVL 18

Accepted Solution

by:
Andrew Davis earned 500 total points
ID: 38765777
save the code below to a file called {whatever}.vbs on the desktop

ServerShare = "\\Server\data"
DriveLetter = "Y:"
NetDomain = "Domain.local\"
UserName = NetDomain & InputBox("Username:")
Password = InputBox("Password:")

Set NetworkObject = CreateObject("WScript.Network")
Set FSO = CreateObject("Scripting.FileSystemObject")

If FSO.DriveExists(DriveLetter) Then 
	NetworkObject.RemoveNetworkDrive DriveLetter, True , True
'	WScript.Quit
End if
NetworkObject.MapNetworkDrive DriveLetter, ServerShare, False, UserName, Password
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "%windir%\explorer " & DriveLetter & "\"

MsgBox("Click OK When you are finished!")
If FSO.DriveExists(Driveletter) Then 
	NetworkObject.RemoveNetworkDrive DriveLetter, true , True
	'WScript.Quit
End if

Set FileName = Nothing
Set Directory = Nothing
Set FSO = Nothing
Set ShellObject = Nothing
Set NetworkObject = Nothing

Open in new window


You will need to adjust the script at the top with your domain and what drive letter you want to use.
0
 

Author Closing Comment

by:dxwieland
ID: 38767235
This works perfect for what we are doing.  Thanks a Million!!

Daniel
0
 

Author Comment

by:dxwieland
ID: 38775506
Andrew,

Is there a way to mask the password on that VBS script you gave me?

Thanks

Daniel
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring Remote Assistance for use with SCCM
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question