Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


mapdrive

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3586
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> mapdrive
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 mapdrive - 6/30/2005 2:08:07 AM   
  linstead

 

Posts: 23
Score: 0
Joined: 6/30/2005
From:
Status: offline
i wanted a user to run a script and map a couple of drive but as a different user so i wanted a input box and have them check with AD to for there account and them map
 
 
Post #: 1
 
 Re: mapdrive - 6/30/2005 2:11:02 AM   
  linstead

 

Posts: 23
Score: 0
Joined: 6/30/2005
From:
Status: offline
Option Explicit

On Error Resume Next



<package>
<job id="DoneInVBS">
<?job debug="true"?>
<script language="VBScript">

Dim Yourname, sDomain, StrPassword
Dim Greeting
Dim Wshnetwork
Dim TryAgain

'Map Network drive also it will not let you map the drive on till you enter a name

Set WshNetwork = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")

sDomain = WshNetwork.UserDomain

Do
TryAgain = "No"
'*************************************************************
YourName = InputBox ("What is your Name")
StrPassword = InputBox("What is Your Password")


If YourName = "" Then

Greeting = "I see that you don't what to give me your name"
TryAgan = "Yes"
MsgBox greeting
Else
Greeting = "Welcome " & YourName & " Your Drives are Mapped"
TryAgain = "No"
End If


Loop While TryAgain = "Yes"

MsgBox Greeting

'***************************************************************


MapDrive "R:", "\\**********\apps$"
MapDrive "K:", "\\**********\appsQa$"
MapDrive "T:", "\\**********\buildqa$"
MapDrive "U:", "\\**********\build$"


Function MapDrive( letter, UNCname)

If fso.DriveExists( letter ) Then
WshNetwork.RemoveNetworkDrive letter
End If

WshNetwork.MapNetworkDrive letter, UNCname

End Function
'****************************************************************


</Script>
</job>
</package>

(in reply to linstead)
 
 
Post #: 2
 
 Re: mapdrive - 6/30/2005 10:38:29 AM   
  Xandros

 

Posts: 100
Score: 0
Joined: 6/23/2005
From:
Status: offline
Why are you requesting username/password? You're not doing anything with them except to ensure the username isn't blank... any non-blank value will fall through to the code to map the drives. Aren't your users already authenticated? I'm kind of unclear on what your objective is. Also, having a user enter a password like this (plain text visible on the screen) is a security risk.

(in reply to linstead)
 
 
Post #: 3
 
 Re: mapdrive - 6/30/2005 11:06:26 AM   
  linstead

 

Posts: 23
Score: 0
Joined: 6/30/2005
From:
Status: offline
i will not leave the username and password field blank it just in testing purpose, what i want to do is went the user run the script it prompt them to enter there username and password which i want to check with active directory. the reason been is there regular accoutn only have read access so they have another account that have full access.

thanks

(in reply to linstead)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> mapdrive Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts