Jump to content
Sign in to follow this  
Palmerj

DriveMapAdd fails... sometimes

Recommended Posts

Palmerj

Hi,

The following fails:

$Usr = InputBox("Security Check", "Enter your User ID without the Domain\")  
$Passwd = InputBox("Security Check", "Enter your password (it will be masked).", "", "*") 

$val = DriveMapAdd("P:", "\\servername\sharename", 0, "domain\"&$Usr, $Passwd)
The DriveMapAdd function errors out with return code 1, the @extended code is 1208 "An extended error code has occurred" which isn't much help.

The interesting thing is that this works on all remote network sites except one.

Obviously there are some differences between network configurations that I'm now digging into, but wanted to find out if anyone has experienced this.

By the way, using the DriveMapAdd function without the user account information works.

$val = DriveMapAdd("P:", "\\servername\sharename", 8)

Any help greatly appreciated.

Share this post


Link to post
Share on other sites
JLogan3o13

The only time I have had DriveMapAdd fail is when there is a slow link between sites, though I could not say what the timeout is. A couple of suggestions:

  • As you noted, DriveMapAdd will default to using the logged in user's credentials if you do not supply them. If you are only going to be mapping drives as the user logging in, omitting the two InputBoxes will make things run more smoothly.
  • I notice you're missing spaces between "domain\"&$Usr. You might try adding the spaces to see if this resolves it for you.

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Palmerj

Hi.

Here is some additional detail that I just found out. The share resides in a NAS device. If I try the same script on the same computer, but change the connection to a share that resides on a regular server, it works.

Response seems adequate, but I'll run some wire shark to see if there is any latency or other traffic.

I added the space as you suggested, but this really made no difference, the script does work on other remote network sites. It is just this one site that has the problem.

Continuing to dig....

Thank you very much for your suggestions.

Share this post


Link to post
Share on other sites
Palmerj

Issue solved!

I am posting the resolution in case it might help others.

Server logs showed the following KRB error during script run: KRB5KRB_AP_ERR_TKT_NYV.

This error occurs when the time between the client and authenticating server are out of synch. By default, Kerberos authentication uses a 5 minute "window" to prevent "play back" attacks. The remote time server (and the remote client) were off by 8 minutes from the local authentication server.

Synchronizing the time between the time services cured the problem.

Thank you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.