Map Network Drive/Security Requirements

brunell316

New Member
Joined
Dec 10, 2014
Messages
10
Hey all,

I have been able to map a network drive of a sharepoint site after I logged into it successfully. I want to make it as painless as possible for other people however. I am using smart card credentials to access the sharepoint so the username and password functions do not work in this case. Is there a way to use those credentials for username and password or atleast have the window automatically open up for the user to input their credentials? Here is the code I have for mapping the drive.

Set Wshnetwork = CreateObject(Wscript.Network)
Wshnetwork.MapNetworkDrive "Z:", "url.com"

- That code pops up that the credentials don't allow access. If I map it manually, this is when the Windows Security window opens and the smart card credentials and pin are entered and allowed access.

I have tried

Set Wshnetwork = CreateObject(Wscript.Network)
Wshnetwork.MapNetworkDrive "Z:", "url.com", False, "SmartCard name", "Pin"

And then I get an error saying "The network name cannot be found" . If anybody has any insight on how to get this to work, that'll be awesome. Thanks!!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hey all,

I have been able to map a network drive of a sharepoint site after I logged into it successfully. I want to make it as painless as possible for other people however. I am using smart card credentials to access the sharepoint so the username and password functions do not work in this case. Is there a way to use those credentials for username and password or atleast have the window automatically open up for the user to input their credentials? Here is the code I have for mapping the drive.

Set Wshnetwork = CreateObject(Wscript.Network)
Wshnetwork.MapNetworkDrive "Z:", "url.com"

- That code pops up that the credentials don't allow access. If I map it manually, this is when the Windows Security window opens and the smart card credentials and pin are entered and allowed access.

I have tried

Set Wshnetwork = CreateObject(Wscript.Network)
Wshnetwork.MapNetworkDrive "Z:", "url.com", False, "SmartCard name", "Pin"

And then I get an error saying "The network name cannot be found" . If anybody has any insight on how to get this to work, that'll be awesome. Thanks!!

I'm having a similar issue where my MapNetworkDrive works for Win 10 (guess it stores credentials) but it don't work in Win 7 (err.number 75).
 
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top