Solved

Shortcuts that prompt for Domain Authenication

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
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…

734 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