473,769 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Map network drive for user using VB/ASP.NET

Hello,

I'm trying to create an admin page that can run miscellaneous scripts for
our IT department. Currently, I'm trying to create a script that can map a
network drive for a user (e.g. a form where I can input \\path\folder, drive
letter, and domain\user). Is this possible? If so, can someone point me in
the right direction?

Thank you,
Brian Nicholson
Jun 29 '08 #1
24 3687
"Brian Nicholson" <Br************ @discussions.mi crosoft.comwrot e in
message news:3A******** *************** ***********@mic rosoft.com...
I'm trying to create an admin page that can run miscellaneous scripts for
our IT department. Currently, I'm trying to create a script that can map a
network drive for a user (e.g. a form where I can input \\path\folder,
drive
letter, and domain\user). Is this possible? If so, can someone point me in
the right direction?
Not natively through ASP.NET, for fairly obvious security reasons - remember
that web app cannot have any direct interaction with client machines due to
the disconnected architecture of the web...

To achieve this you'd need to look at something like a custom ActiveX
control - can't recommend it...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 29 '08 #2
If you get to Technet as well as elsewhere you will learn about PowerShell
which has become the optimal way to use the framework for administrative
tasks.
"Brian Nicholson" <Br************ @discussions.mi crosoft.comwrot e in
message news:3A******** *************** ***********@mic rosoft.com...
Hello,

I'm trying to create an admin page that can run miscellaneous scripts for
our IT department. Currently, I'm trying to create a script that can map a
network drive for a user (e.g. a form where I can input \\path\folder,
drive
letter, and domain\user). Is this possible? If so, can someone point me in
the right direction?

Thank you,
Brian Nicholson
Jun 29 '08 #3
"Junior" <so******@somew here.comwrote in message
news:O0******** ******@TK2MSFTN GP05.phx.gbl...

[top-posting corrected]
>I'm trying to create an admin page that can run miscellaneous scripts for
our IT department. Currently, I'm trying to create a script that can map
a
network drive for a user (e.g. a form where I can input \\path\folder,
drive letter, and domain\user). Is this possible? If so, can someone
point me in the right direction?

If you get to Technet as well as elsewhere you will learn about PowerShell
which has become the optimal way to use the framework for administrative
tasks.
PowerShell won't allow a web app map a network drive via a client browser
without using ActiveX and seriously ramping down the security level - at
that point, you may as well not bother...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 29 '08 #4
"Mark Rae [MVP]" wrote:
>
Not natively through ASP.NET, for fairly obvious security reasons - remember
that web app cannot have any direct interaction with client machines due to
the disconnected architecture of the web...

To achieve this you'd need to look at something like a custom ActiveX
control - can't recommend it...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Forgive my ignorance as I am very new to ASP.NET, but what would be the
security problems of a web app that uses IIS with Integrated Windows
Authentication? Also, I thought that mapping network drives was a
user-specific task (not machine-specific) -- if that even makes a difference.

Thank you for your help.
Jun 30 '08 #5
"Brian Nicholson" <Br************ @discussions.mi crosoft.comwrot e in
message news:B0******** *************** ***********@mic rosoft.com...
>Not natively through ASP.NET, for fairly obvious security reasons -
remember
that web app cannot have any direct interaction with client machines due
to
the disconnected architecture of the web...

Forgive my ignorance as I am very new to ASP.NET, but what would be the
security problems of a web app that uses IIS with Integrated Windows
Authentication? Also, I thought that mapping network drives was a
user-specific task (not machine-specific) -- if that even makes a
difference.
It's not the web app per se - it's the browser. All modern browsers are
specifically designed to prevent *any* direct interaction with the user's
hardware other than for things like cookies etc. The fact that you're using
Windows authentication in an intranet environment is of no concern to the
browser, which is the same browser that you use to go out onto the public
Internet and do your on-line banking etc - the browser itself doesn't
understand the difference. All it knows how to do is send an HttpRequest to
a webserver and then process and display the HttpResponse which the
webserver streams back to it - makes no difference whether that webserver is
in your comms room or half-way round the world.

To give you a rather extreme example, imagine a web app which could stream
down an instruction to the client browser to run the equivalent of "format
c:" on the client machine...

Mapping a network drive involves direct interaction with the client machine
as far as the browser is concerned, so it's not permitted.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 30 '08 #6
So you are the kind of guy who makes excuses rather than finding an
acceptable way to get things done?
"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:ue******** ******@TK2MSFTN GP06.phx.gbl...
"Junior" <so******@somew here.comwrote in message
news:O0******** ******@TK2MSFTN GP05.phx.gbl...

[top-posting corrected]
>>I'm trying to create an admin page that can run miscellaneous scripts
for
our IT department. Currently, I'm trying to create a script that can map
a
network drive for a user (e.g. a form where I can input \\path\folder,
drive letter, and domain\user). Is this possible? If so, can someone
point me in the right direction?

If you get to Technet as well as elsewhere you will learn about
PowerShell which has become the optimal way to use the framework for
administrati ve tasks.

PowerShell won't allow a web app map a network drive via a client browser
without using ActiveX and seriously ramping down the security level - at
that point, you may as well not bother...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Jun 30 '08 #7
"Mark Rae [MVP]" wrote:
>
It's not the web app per se - it's the browser. All modern browsers are
specifically designed to prevent *any* direct interaction with the user's
hardware other than for things like cookies etc. The fact that you're using
Windows authentication in an intranet environment is of no concern to the
browser, which is the same browser that you use to go out onto the public
Internet and do your on-line banking etc - the browser itself doesn't
understand the difference. All it knows how to do is send an HttpRequest to
a webserver and then process and display the HttpResponse which the
webserver streams back to it - makes no difference whether that webserver is
in your comms room or half-way round the world.

To give you a rather extreme example, imagine a web app which could stream
down an instruction to the client browser to run the equivalent of "format
c:" on the client machine...

Mapping a network drive involves direct interaction with the client machine
as far as the browser is concerned, so it's not permitted.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

I kind of understand what you're saying, but I didn't think I was using the
browser itself as a means to perform the task -- I don't want the drive to be
mapped on the client computer that's actually going to the web app. I was
considering something like an admin page where the admin could enter certain
things like a network path, username, etc., and the app would use these
values in a VB script which could then perform the function (as if we weren't
using a web app to begin with), e.g. using something similar to VBScript's
MapNetworkDrive .

I apologize if you knew this already and I misunderstood your post.
Jun 30 '08 #8
PowerShell
"Brian Nicholson" <Br************ @discussions.mi crosoft.comwrot e in
message news:E6******** *************** ***********@mic rosoft.com...
"Mark Rae [MVP]" wrote:
>>
It's not the web app per se - it's the browser. All modern browsers are
specifically designed to prevent *any* direct interaction with the user's
hardware other than for things like cookies etc. The fact that you're
using
Windows authentication in an intranet environment is of no concern to the
browser, which is the same browser that you use to go out onto the public
Internet and do your on-line banking etc - the browser itself doesn't
understand the difference. All it knows how to do is send an HttpRequest
to
a webserver and then process and display the HttpResponse which the
webserver streams back to it - makes no difference whether that webserver
is
in your comms room or half-way round the world.

To give you a rather extreme example, imagine a web app which could
stream
down an instruction to the client browser to run the equivalent of
"format
c:" on the client machine...

Mapping a network drive involves direct interaction with the client
machine
as far as the browser is concerned, so it's not permitted.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


I kind of understand what you're saying, but I didn't think I was using
the
browser itself as a means to perform the task -- I don't want the drive to
be
mapped on the client computer that's actually going to the web app. I was
considering something like an admin page where the admin could enter
certain
things like a network path, username, etc., and the app would use these
values in a VB script which could then perform the function (as if we
weren't
using a web app to begin with), e.g. using something similar to VBScript's
MapNetworkDrive .

I apologize if you knew this already and I misunderstood your post.
Jun 30 '08 #9
"Junior" wrote:
>
PowerShell
I have no experience at all with PowerShell (I have very little experience
with ASP.NET as it is), but if it's able to do this through ASP.NET then I'm
interested. Do you happen to know how it can be done? After a quick search,
I found articles mentioning the same MapNetworkDrive that exists in VBScript
-- the problem with this method is that it requires the password of the user
I'm mapping a drive to.
Jun 30 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3656
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore my settings if my profile became tampered with or corrupt. Is there any sample code available out there? -Robert
2
5808
by: giloosh99 | last post by:
Hello, Im grabbing tables via VB code using visual foxpro ODBC drives. The tables directory is in a mapped network drive. The code works fine and does the job, however if the computer is idle for a while the network drive apears to have a red X on the icon and the drive becomes disconnected. this seems to effect the VB code from grabbing the tables. I get an error saying the specific table cannot be found. If i manually open the mapped...
1
6571
by: brian.oneil2 | last post by:
Is there a way to install this onto a network file share and allow a team to access it? I would say share a CD from a networked CD drive, but there are multiple CD's that would have to be inserted. TIA, Brian
8
11853
by: Lam | last post by:
HI anyone knows how can I open a mapped network file in C#? I try string file = @"T:\file.txt"; it shows me the error: "Could not find a part of the path" but if I copy the file to my C dirve, and use @"C:\file.txt"; it worked Thanks a lot
5
4476
by: Nirosh | last post by:
Hi All, Can any one suggest me a best way to do this .. I have a thrid party tool "EXE" that we need to use with our web service to manipulate some complex XML files, which reside in a seperate files server. we have mapped the fodler to a different folder and need to allow the EXE to process on the mapped drive. When I trigger the EXE via web service the EXE get the permission of the launching user (mean ASP.NET user) resulting a...
3
10586
by: James N | last post by:
My ASP.NET application needs read/write permissions for drive "Z:", which is mapped to my Linksys Gigadrive (Network Attached Storage...if anyone is familiar with that). If I configure the Gigadrive with "Guest" access rights, then everything works fine, BUT this leaves the drive vulnerable to everyone/everything including network viruses. Lately, my drive has had several attacks by the Lovegate virus. Eliminating such attacks...
2
2675
by: .Net Believer | last post by:
I using the routine below to copy file to a network drive for a regular backup process. Before calling this routine I using another function to check the presence of the LAN connection and the server where the network drive exists. Although of this check I am sometimes getting an exception (in 5% of times)saying "Could not find the U:\...\File.ext" or part of its path" Although the network dirve is available and accessible by windows...
1
2191
by: deiopajw | last post by:
I have a Back end database on a network drive. The copies of the front end are located on individual pc's (in their C drive). The problem arises when a laptop user naturally hooks up to the network but then the link from the front end (in the C drive of the laptop) to the back end (network drive) is lost. I have to then go to the tables section of the database window of the Front End and remove the links then link them again with the Back...
0
3231
by: Niyazi | last post by:
Hi, I created application that store the data in SQL SERVER that reside on network. The client also use this application to access the resources provided with application. But is the client want to register new customer or companies they will enter the information in Windows Form and the program automaticaly creates the WORD document under specific folder under application path. Once the empty word file created than ask user if they want...
0
1477
by: danasegarane | last post by:
Hi all I want to map a network drive. If the user has access to that site then that path will map automatically. If the user doesnt have any rights the i need to get the username and pwd from the user by using windows authentication screen. For example the WNetConnectionDialog shows the mapnetwork drive dialogbox.For example if you open an IE explorer and type the servername which you dont have access In the mean while I found...
0
10223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10000
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.