Novell Home

Performing ZENworks Remote Management Based on Usernames

Novell Cool Solutions: Trench
By Daniel Stricharz

Digg This - Slashdot This

Posted: 3 Nov 1999
 

Daniel Stricharz is a frequent contributor of cool tools, ideas, and solutions. As a member of the ZENworks Cool Solutions Board of Review, he labors mightily each week to keep our content accurate and useful to real admins. This is a great example of the kind of practical, field-ripened creativity we always see from Daniel. You're going to love it...

Note: Daniel updated his tool to Version 2 as of April 6, 2000, and this article has been edited to reflect the changes.

You all know that feeling ... you've just got a cool new software application and are already dreaming up new features that should be delivered by yesterday at the latest. If you are an administrator, and I bet you are, you are well justified in having such ideas. Take me for instance: After playing around a few times with ZENworks 1.0 Full Release, shortly after its release, I quickly thought it would be very practical to have faster access to Remote Control by performing this new function based on usernames instead of workstation names. It took me a while (ZENworks 2 was already released) to start working on a self-made solution. Now that I've taken up the challenge, I'm able to proudly present my new-born tool: Quick Remote Actions.

Quick Remote Actions

The main purpose of Quick Remote Actions is to give you fast access to the Remote Management features of ZENworks by letting you do Remote Control based on username, without needing to know the name of the specific workstation object. Quick Remote Actions is an add-on product to Novell ZENworks and requires proper installation of ZENworks on your server and the Remote Management Agents on your workstations. The program does not depend on the use of NetWare Administrator.

Quick Remote Actions provides you with an NDS browser of its own, letting you choose a user or workstation object from the tree and launch one of the Remote Management features that come with ZENworks. In addition to selecting objects from the tree, you can also search for users or workstations with the help of a search box. Once Quick Remote Actions succeeds in launching Remote Control, the chosen object will be added to a history, making accessing specific Remote Control objects even faster.

If you are using ZENworks 2, it will be possible for you to use its new Remote Management features (including Remote Execute, Remote View, Diagnostics, Inventory and others), in addition to Remote Control directly from my application.

Installation

Important: Make sure to make a backup of OLEAUT32.DLL residing on your computer before installing the software. In some rare cases the updated version of OLEAUT32.DLL was reported to make trouble with some third-party products. If that happens, copy your backup version back onto your system. OLEAUT32.DLL is usually located in the directories \windows\system\ or \winnt\system32\. Once you've made the backup, here's what you do.

  1. Decompress the file qra10.zip to a temporary directory.
  2. Choose SETUP.EXE to start the installation.
    Note: During installation you may be prompted to reboot your computer. In this case the setup procedure needs to update the file OLEAUT32.DLL to proceed with the setup.
  3. After rebooting your computer, please restart the installation procedure.

System requirements

  • Windows 95 or higher/Windows NT 4.0 or higher
  • Novell Netware Client
  • Novell ZENworks Full Release

Behind the Scenes

Those of you who, like myself, enjoy experimenting, may want to know how this tool was built. The main task was to link a user object to a workstation so that ZENworks' Remote Management could be correctly performed on the specific workstation the user is working at. Reading the article "Intercepting Program Calls" on the ZENworks Cool Solutions site I learned that for calling Remote Control I would have to know the distinguished name of the workstation object a user is logged into. Unfortunately, this information is not stored in the user object.

The only information that I could rely on is the attribute "Network Address." This attribute gives me information about the IPX and/or TCP/IP address from which the user is logged in. Besides that, I could use this attribute to determine whether the user is logged into the network at all. On the other hand, the workstation object which can be found after import into NDS contains a similar attribute, called "WM:Network Address", of its own.

This information would be needed to create the virtual link between a user and the workstation object. Once I could find matching addresses, I could read the relevant workstation object name and pass it to ZENworks' Remote Mangement tools.

To create Quick Remote Actions I used Visual Basic. I didn't use any direct API calls to access NDS or the network. In fact, there isn't an API call at all in this application. Instead, information was retrieved from NDS and the network using the Novell Controls for ActiveX.

The Novell Controls for ActiveX are a collection of components that can be used to build custom NDS- and NetWare-aware solutions using a variety of programming and scripting languages without having to be a hardcore programmer. Not only did Novell release the Novell Controls for ActiveX at the Novell DeveloperNet Site available for free, they also ensured that - once you've gotten used to them -- it is made really simple to build powerful solutions around NDS and NetWare tailored to meet your individual needs. Looking back at the length of time I needed to create the Quick Remote Actions utility, only around 5% of development time was used for the NDS and network stuff. The other 95% went into writing functions for parsing strings and customizing the interface.

If you download the controls you will see that, for example, just recently Novell added an NDS Browser Control enabling you to incorporate graphical facilities in your application without even having to write one line of code. (OK, you won't have much use for this without code, but you get the idea.) When I started coding my tool, this Browser Control wasn't available, so I had to code it manually. Nevertheless, it was easily done since the Novell Controls for ActiveX come with a bunch of sample projects that make learning how to exploit the Controls really a snap.

Examples

Let's take a look at two examples of code that were used in a similar fashion in my application. There is, for example, the General Settings tab in my application, where I ask you to choose a server from a drop-down list. After you've referenced the appropriate control for use in Visual Basic, you would only need this simple code to retrieve all available NetWare servers from your network and populate a drop-down list:

For Each Server In NWSess.ServerNames
List1.AddItem Server.ShortName
Next

Or to retrieve the network addresses the user is currently logged into the network, I need to read the attribute "Network Address" from NDS:

Dim Entry As NWEntry
Set Entry = NWDir1.Entries("UserFromTree")
Dim userAdress as Variant
userAddress = Entry.GetFieldValue("Network Address", "", True)
For i = LBound(userAddress) To UBound(userAddress)
do something
Next i

Of course, these examples are much simplified here and I've omitted any further explanation of the code. But what I wanted to show you is that there really is no magic behind programming the NDS. In fact, it is now much easier to build custom applications, since all the work you've already put into building and populating your NDS tree can now be exploited in your own software ... no need to re-invent the wheel.

Recommended Reading

  • If you want to learn more on programming with Novell's ActiveX controls make sure to take a look at the tutorials from the Novell DeveloperNet University.
  • There is also a series of articles published on the Novell Developer Notes site on using the ActiveX controls.
  • And if you are looking for some more sample code, take a look at the Sample Code & Resolutions page.

Last Thoughts

A lot of work was put into Quick Remote Actions to make it as comfortable as possible. It is freeware - so feel free to hand it to your colleagues and friends.

I would like to thank Mr. Steve Banks, Shell Gas Direct, for his valuable advice in improving this application and testing the code.

I hope you will have fun with my application. In case you have comments please contact me at dstricharz@jura.uni-wuerzburg.de.

What's New in version 2

  • QRA will now show what workstations a user is logged on instantly.
  • QRA can show customized NDS information for workstation and user objects.
  • If you searched for a user, QRA v1 would have launched the remote management immediately. Now, you will be able to see what workstations are in use by the user first. Moreover, if you use the NDS information pane, general information about a user or workstation can be gathered.
  • The most obvious changes can be noticed on the interface: The Multiple Results tab has been removed and its function is now part of the Remote Action tab. An additional pane was added for displaying customized NDS information. The Workstation Database tab is now included in Settings.
  • You can refresh the display of the tree or any container through right-clicking a container and selecting "Refresh Container List". This will allow you to reflect the addition/move/deletion of user or workstation objects during a QRA session.
  • In QRA v1, if you start a search at the top of the tree and the user is found in a sub container you would need to browse back to the top in order to start another search from top of the tree. Otherwise, your next search would start in the current container shown in the browser. To counter this, a permanent starting point for searches can be set now.
  • Setting the default remote action can be done from a small drop-down box at the Remote Actions tab.
  • User and workstation objects are displayed using traditional distinguished names in NDS.
  • If your environment consists of more than one NDS tree, QRA can be invoked with the new command line argument "/tree=".
  • Bugs in the way the workstation database file was built have been fixed.
  • The history feature was fixed. Version 1 would sometimes overwrite old entries while adding new ones.
  • Querying the Inventory DB server using QRA finally works. A bug in QRA v1 rendered this function useless.
  • ... and many more bugs are fixed.

Download the Tool

qra2.zip

This file contains Version 2 of Quick Remote Actions. Checkout the readme.txt in the zip file for installation instructions.

Q&A about Version 1 of this tool

Jeff R. wrote: I just wanted to say this is a great tool. The other day I responded to ZENworks Cool Solutions explaining my problem and I see he put out a patch. I am still having a problem, but it's a new one. My pc's are now being imported where they weren't before, but when I try to initiate remote control I get an error message box that says
CANNOT EXECUTE BECAUSE THE COMMAND LINE IS INVALID
NETWORK NAMES ADDED SUCCESSFULLY
TO CANCEL ATTEMPT TO REMOTELY MANAGE, CLICK HERE

Wanted to know if other readers are still experiencing problems.

DANIEL: I located the problem in QRA not being able to correctly pass values to ZENworks Remote Mangement software if a space character exists either in the workstation object's name or in the context of the workstation. The problem is resolved after applying a new version of the file qra.exe, found in qra10b.zip (Full Version) and qra10bupd.zip (Update Version).

Moreover, this version introduces several new command line options. You can now automate database creation and specify upon startup which database file should be used. These were the most requested features and they should make working with QRA in a multi-user environment much easier. To learn about the new command line options see the help file or use the command qra /?.

Daniel welcomes feedback about this tool. Feel free to contact him directly with questions, suggestions, and observations.
dstricharz@myrealbox.com

About the Author

In 1993, Daniel Stricharz first began working as a NetWare administrator. He has since gradually learned to enjoy the flexibility of NDS-based administration and the power of ZENworks. Quite apart from the ease and speed of deploying desktop solutions through ZENworks, Daniel likes the way the program allows a new level of personal creativity in day-to-day administration tasks.

"Using ZENworks not only enables me to concentrate on real technical problems, but also gives me much more time to spend on my scientific work at the faculty of law," Daniel told us. "Learning ZENworks was not that hard, really. Most problems were easily resolved by skimming the Support Forums and the Cool Solutions Site. Also, now that Novell made the ActiveX Controls available, I'm able to build custom applications taking full coverage of NDS and NetWare. I prefer to program in Visual Basic, so Novell's Controls were just the right thing for me. With all the sample code available, it didn't take me too long to create my first NDS-based application," he said. "Once you see your own little application suddenly working perfectly in combination with NDS, you become pretty proud", Daniel concluded.

Since 1994, Daniel Stricharz has been editor for the German law journal 'Datenschutz-Berater', covering Privacy Law and Data Security. He also works as a freelance IT consultant and lecturer to law fims and financial advisors.

His scientific work in the field of law includes Privacy Law, Data Protection and Data Security. Most recently, he contributed to judicial projects covering legal and technical issues relating to the liability of Internet Service Providers, e.g. for the Multimedia Law Handbook, Hoeren/Sieber (ed.) 1999, and the study 'Legal Aspects of Computer-Related Crime in the Information Society' sponsored by the European Commission.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell