I have a weird script problem. I am testing out an approach that we would like to implement to access network files via a button on a form. These network files are secured, so in order to get them, I have to map a drive and pass credentials.
The script behind the button is something similar to this:
Couple of things:Re the ‘reset’ issue - that rightly belongs to the OS. Have you been to any of the MS sites and asked how you might do this in VB/VBA? The code structures should work the same in LS so if there is something you need to do, you’ll find the answers there.
You may want to also look into WSH options - not sure if it handles mapping, but it’s worth a look.
I’m STILL not understanding why you even need to muck with user names/passwords. I’m logged into the network. My login gives me rights to shares. Why would I have to re-authenticate to a share I have rights to use? Are you creating bogus user names/passwords for logins? If so, just remember that users can use the debugger and see whatever you have in the code.
“I’m STILL not understanding why you even need to muck with user names/passwords. I’m logged into the network. My login gives me rights to shares. Why would I have to re-authenticate to a share I have rights to use? Are you creating bogus user names/passwords for logins? If so, just remember that users can use the debugger and see whatever you have in the code.”
Well, in my case the agent runs on the server overnight. The Server does not have the shared drives mapped that I want to use, so I map them using an ID / Password we created (so the passwords don’t expire)
Because I don’t have exclusive rights to that server it’s used across the corporation where the share is for a business specific application.
My application figures out what drive is “free” and then maps it and disconnects things once done. In theory then lots of business could use the same server.
I modified the spacing inbetween user name and password as Steve suggested. There was no difference in the performance.
However, I did notice that when I step through the script using the Lotusscript Debugger, it works every single time.
When I run the script without the debugger, it works only EVERY OTHER TIME.
Doug - we have a ton of documents out on a network share. Right now, the permissions on the share are open to all domain users. Our auditors want us to tighten up access on the share so that users cannot browse/access files. The network share contains over 3000 folders, all requiring different access levels. This is way too much for our admins to tackle. Our idea was to close off the access except to one administrative account and pass those credentials on via Notes. We can control access to the notes database with out much effort. Hope that makes sense.
Maybe you can write stuff to the log and determine where it’s failing when it runs every other time? I’m betting it’s the mapping of the drive. If you can write the error messages to a text file one your servers C drive maybe it will tell you something:
You have the problem that you’ve now implemented security by obscurity. The username/password is available to any Notes user who figures out they can run the debugger and step through the code. Once one person has the credentials, your security model is broken and you have nothing to stand on during an audit.
You really need to rethink your whole network topology at this point. You don’t need 3000 shares, figure out what you do need, who needs access, where it should live, and fix the root problem. It’s gonna hurt but what you’re proposing is a very very bad patch.
You can, but this only makes things a little harder, since the string constants are still stored in the object code and someone with a little tech savvy (or a copy of NotesPeek) can easily scan thru this data and find them. You could of course encrypt them somehow and have a little decode routine, so that the cleartext information doesn’t have to appear in the object.
Update - Adding Sleep (5) to the code solve my problem. Andre was correct that there was not enough time to connect before executing the next line of code.
As for the security issues, I will definitely bring all the concerns to the table before implementing this.
The problem is that the commands you’re using only launch the process you want to run – they don’t wait for it to finish. So they’re running in parallel, overrunning each other and sometimes they fail because you try to use the net drive while it’s still not set up, or try to delete it while it’s still in use. If you write all the commands into a batch file and run it, it might work better. Though you will then want to delete the batch file afterwards; maybe there’s a way to have the batch file delete itself? Consult a DOS batch file expert – you will find them at the local retirement community.