MapDrive Script

Status
Not open for further replies.
Joined
Jan 2, 2012
Messages
16
Hello below you will find a useful script for mapping a network drive.
I know there are different ways of doing this but this is super simple and works for XP to 2008

'Drive Map and File copy from remote host to local host
'Written By Sean Hulbert
'March 06 2008

Dim strDriveLetter1, strRemotePath1, strUser, strPassword, strProfile
'Drive letter will remain static
strDriveLetter1 = "z:"
strRemotePath1 = "\\x.x.x.x\sharename"

strUser = "usernamehere"
strPassword = "Passwordhere"
strProfile = "false"

Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1, _
strProfile, strUser, strPassword

WScript.Echo "Server connection has been configured Files downloaded"
WScript.Quit
 
whats wrong with

net use \\server\share

Yes, you can inject user and password into that, but that is not a secure way to map a network drive. If you have server 08 you should have a domain, and its users and passes controlling security access, not your login script
 
Your correct but there are those out there that would like to see the script code and its not a security risk as it is written. If you see a risk please explain in detail. As for a Domain all you would end up doing is use username@domainname for the username field.
 
Your correct but there are those out there that would like to see the script code and its not a security risk as it is written. If you see a risk please explain in detail. As for a Domain all you would end up doing is use username@domainname for the username field.

It's not a security risk to include a non hashed password in a plain text file?

And in a domain using a login script for mapping drives is antiquated at the least.
 
I assume this is for a workgroup?

if not, its a very strange way to do things.

If you have to use a script then net use {drive letter:} \\{machine name}\{share name}
 
There are hundreds of renditions of the OPs vb script. I know I found it while I was starting to get tired of Kixtart. Like AMD Said too Group Policy in 2008/2008 R2 makes it even more easier with the Group Policy Prefs

Doing the Script this way could get long and drawn out if you have lots of drives to be mapped, drives based on security groups, specific functions..


where is the refund line so I can get my 30 seconds of life back?
 
Wow, yeah, that script is a terrible idea. You would need to have a different script for each user unless you're going to have everyone connect to the network share as the same user. Not even sure if this would work in a domain environment since windows doesn't like users connecting to the same server with more than one set of credentials.

Then there is that whole completely unencrypted username/password. Dude, it's 2012 not 1993okay, security is essential.
 
Wow, yeah, that script is a terrible idea. You would need to have a different script for each user unless you're going to have everyone connect to the network share as the same user. Not even sure if this would work in a domain environment since windows doesn't like users connecting to the same server with more than one set of credentials.

Then there is that whole completely unencrypted username/password. Dude, it's 2012 not 1993okay, security is essential.

I believe the OP even stated in a different thread that he was a security professional for the government or something like that.
 
Another forum member here and myself questioned this guy last night and we both got infractions. Just giving you guys the heads up.
Indeed. I looked through and he seems to want to make hard forum his blog.
 
Another forum member here and myself questioned this guy last night and we both got infractions. Just giving you guys the heads up.

An infraction for this post would be ridiculous, given 2 things.

This material is widely available via google and there is 100 different renditions of it.
This is also extremely poor way of mapping drives. Pointing it out shouldn't be a crime.

Now for the other stuff that was questions I can't find this chaps other posts or what was said, but no less
 
An infraction for this post would be ridiculous, given 2 things.

This material is widely available via google and there is 100 different renditions of it.
This is also extremely poor way of mapping drives. Pointing it out shouldn't be a crime.

Now for the other stuff that was questions I can't find this chaps other posts or what was said, but no less

This is him explaning himself as a Security Professional making almost $400k/year. http://hardforum.com/showpost.php?p=1038215991&postcount=39

I guess his job and consulting gig are slow so he decided to come on the forum here to kill some time.
 
Status
Not open for further replies.
Back
Top