Solved

Shortcuts that prompt for Domain Authenication

Posted on 2013-01-09
5
586 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
  • 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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

821 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