Solved

Shortcuts that prompt for Domain Authenication

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
This video Micro Tutorial is the first in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles al…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now