|
-
May 2nd, 2001, 09:42 AM
#1
Thread Starter
Addicted Member
Is this even possible?
We are using Windows 98 on an Novell Network. Currently, we use the task scheduler to perform various task on the local machine. One problem is that the task will execute when the user is not logged on to the network, however, there the program can only access the local machine.
Is there a way (API or similar) that the program we execute could be coded in such a way that it would log into the network - execute its task, then - log back off again?
-
May 2nd, 2001, 10:11 AM
#2
Retired VBF Adm1nistrator
Well why not leave the computer in question logged in ?
Or, leave a particular computer logged on 24/7 with limited rights, and then have the computers that are not logged on ask that computer to do the jobs for them ?
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
May 2nd, 2001, 10:43 AM
#3
Lively Member
Yes, the NetWare API lets you do that.
The basic sequence is:
NWCallsInit
NWDSCreateContextHandle
NWDSGetContext
NWDSLogin
That gets you logged into the tree.
To then get to a particular server:
NWAttachToFileServer
NWDSAuthenticateConn
Then map a drive:
NWGetDriveStatus - loop to find available letter
NWSetDriveBase
If you're still bindary only, things are a bit different.
-
May 2nd, 2001, 10:45 AM
#4
Lively Member
Also, when you're done, make sure you clear the connection and logout.
-
May 2nd, 2001, 10:45 AM
#5
Thread Starter
Addicted Member
The types of activities that we would want to execute would require more rights that we feel comfortable leaving signed on.
Thanks
-
May 2nd, 2001, 10:55 AM
#6
New Member
Well, the main problem I see with what you want is that a user could wait for that computer to logon at night, then sit down and do what ever he wants with whatever high and mighty permissions you give that login. You could get a computer, remove monitor, keyboard, mouse and then put that in a room that is locked from normal people (a server closet maybe) and then stay logged in on that? I dunno.
-
May 2nd, 2001, 10:56 AM
#7
Lively Member
Note that this requires you to embed a userid and password in the code and that the password never expire (otherwise the program has to be regenerated for each password change). A reasonably safe way to do this is to create the userid and password so that no plain text is available in a dump. For example:
UserID(1)=chr(a+b)
UseriD(2)=chr(c+d)
.
.
.
where a+b ,etc, are expressions whose values are characters of the shh, secret, string being built.
-
May 2nd, 2001, 11:04 AM
#8
Thread Starter
Addicted Member
This look exactly like what I'm wanting to use... however, I'm not real familiar with API's. Is the NetWare API something that I should have availible as a NetWare user, or is it something that I need to purchase separately?
-
May 2nd, 2001, 12:27 PM
#9
Lively Member
Pricey subscriptions used to be the rule, but now they're free:
http://developer.novell.com/ndk/bykit.htm
The guys you'll want are:
NDS SDK
NetWare SDK for C
Novell Win32 SDK for C
Although the samples and documentation are for C, if you're used to using WIN API calls you shouldn't have that difficult a time. I would guess the hardest thing will be to figure out which DLL has the entry points you want to use.
-
May 2nd, 2001, 12:30 PM
#10
Lively Member
'smatter of fact, I'll see if I can't do the above with VB6.
Stay tuned...
-
May 2nd, 2001, 02:15 PM
#11
Thread Starter
Addicted Member
Thanks Cookre...
I found the kits on Novell's web site, but I was confusted because I only saw ones for C and Java. I did try and download the C one, but I got an error. It's been one of those days!
-
May 2nd, 2001, 03:40 PM
#12
Lively Member
It'll likely be a day or two - my boss just gave me something to do.
Of all the nerve!
BTW, that's all they have - C and Java. You will have to get the C packages downloaded and installed since they have some DLLs you'll have to place on the client box.
-
May 4th, 2001, 10:52 AM
#13
Thread Starter
Addicted Member
I found lots of code samples on the Novell Web Site :
Novel VB Samples
I think I can muddle through and figure out what I need. Only problem I have left is I'm not sure of what to do when I want to logout and clear everything.
-
May 4th, 2001, 12:35 PM
#14
Lively Member
That's easy:
1) Close any connections you made with either NWCCCloseConn() or NWClearConnectionNumber().
NWCCCloseConn closes a connection explicitly created by the program. NWClearConnectionNumber is used to close connections from the server to other clients (console rights needed for this one).
If you're going to make multiple connections to multiple servers and you want to clear connection X to server Y, make sure you set the current connection to one from server Y before clearing. You have to do this since NW looks up the connection number in its' 'current' server's connection table.
2) Logout of the tree with NWDSLogout().
NWClearConnectionNumber() does the equivalent of a bindery logout from the specified server (assuming there are no other connections from the client to that server), but you still need to eventually logout from the tree gracefully.
-
May 4th, 2001, 12:38 PM
#15
Lively Member
PS: Thanks for the link.
I've done lots of NWAPI programming in C, but none in VB I must have had a brain fart when searching the other day 'cause I didn't find that page on Novell (someplace I visit lots)).
-
May 4th, 2001, 12:56 PM
#16
Hyperactive Member
Couldn't you just leave it logged in and use a screen saver password?
-
May 4th, 2001, 03:52 PM
#17
Thread Starter
Addicted Member
Couldn't you just leave it logged in and use a screen saver password?
Actually, what I am trying to do with this is to give rights to the program that the user wouldn't normaly have, therefore I want to make sure that I get this program logged out.
Thanks to all for your help - esp Cookre!
-
May 4th, 2001, 10:40 PM
#18
New Member
I found the kits on Novell's web site, but I was confusted because I only saw ones for C and Java. I did try and download the C one, but I got an error. It's been one of those days!
What exactly does CONFUSTED mean?
Just kidding. I found this post to be very informative.
 Thanks a Million 
-
May 7th, 2001, 02:27 PM
#19
Thread Starter
Addicted Member
I'm using NWScanObject to give me a list of the availible servers on out network. We have two NT servers that are not showing up. Is that because they are not Novell?
-
May 7th, 2001, 03:30 PM
#20
Lively Member
Are you doing this from an authenticated connection with rights to the target objects?
-
May 7th, 2001, 04:17 PM
#21
Lively Member
OK, now that I've read the question AFTER responding...
Even the bindery calls get their info from NDS, and NT servers don't advertize their existence to NDS (or, if youo prefer, NDS doesn't know about the NT servers).
The first place I'd look within the NW API is NWGetKnownServersInfo(), but even there I'm not sure if the NT servers will be found. I suspect you'll have to slop over to the Platform SDK and start the search with WNetOpenEnum().
-
Jun 1st, 2001, 10:50 PM
#22
New Member
I've been working on this and have had some pretty good luck. The program that I have now will logon the computer and start another run. I have it set up so that when the second job finishes, the login program will then log off. Works fine on my computer, but when I try to install it on another computer, the map functions don't seem to want to work. I see a couple of Novell dlls in the package and deployment program. but I have a feeling that I'm not getting something setup right. Do I need to install the SDKs on the second computer? Am I missing some files or references?
 Thanks a Million 
-
Jun 2nd, 2001, 12:57 PM
#23
Lively Member
Many large Novell sites will have and maintain the appropriate dlls on the clients (or, most commonly, in a directory in the path) for any client side NDK app they may need to use. I've never been willing to trust the performance of any of my code to whatever crap happens to be on a client box, so I always do static links. Sure the exes are larger, but at least they're entirely self-contained.
If, for some reason, a static link is not an option for you, you'll need to make an installation package for your app that has all needed ancillary files. Quite frequently, the needed dlls are named the same as the libs passed to the linker.
-
Jun 2nd, 2001, 01:17 PM
#24
Lively Member
The brain fails again. I forgot this is a VB forum and I don't think static linking is an option for a VB executable.
Does anyone know if this is possible?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|