[dba-VB] Unusual VB Request

Michael Maddison michael at ddisolutions.com.au
Sun Feb 20 16:17:02 CST 2011


Thanks Stuart,

 

Yes, you are correct! It is a Maximo installation.

The code I've been asked to replace is a 3rd party dll that Maximo calls
to allow for single logins.

So in effect I supply the login info to Maximo, the original code used
NetWkstaUserEnum but I have changed it to WMI.

WMI is superior in that it returns the actual logged in user. The API
returned a collection of ALL logins.

It appears that some change in environment caused the API to return its
collection slightly differently so the single login started to fail.

 

Cheers

 

Michael

 

From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart
McLachlan
Sent: Sunday, 20 February 2011 11:07 PM
To: Discussion concerning Visual Basic and related programming issues.
Subject: Re: [dba-VB] Unusual VB Request

 

I'd say you are SOOL. 

Initially it didn't make sense needing a IP address *and* Hostname  to
get an OS Username
so I did a bit of googling.

The key was .psdi

It appears that psdi classes are implementations of an Interface to the
IBM's (originally
PSDI's) java based Maximo Asset Management System.  

I'd guess that the function is looking at the Maximo database which is
running on Hostname
to find out if someone is logged into it from the workstation at IP
address and returniing the
username if there is someone logged in.

Without knowing a lot more about the internals of Maximo, there is no
way to come up with
an independent way of getting this information

It is the same as asking who if anyone on workstation xxx.xxx.xxx.xxx is
logged into an SQL
Server instance.   You need to know how that information is stored
inside the the RDBMS,
how to gain access to that data and how to extract it.

--
Stuart

On 19 Feb 2011 at 11:06, Michael Maddison wrote:

> Hi Guys,
>
>
>
> Maybe someone can confirm or negate my thoughts on a client request I
> have received?
>
>
>
> Consider this code...
>
> import psdi.util.AXWin32Util;
>
>
>
> Call to DLL:
>
>
>
>         if (this.debug) {
>
>           System.out.println("Checking for user at ip " + address + "
>           on
> " + host);
>
>         }
>
>         OSUsername = AXWin32Util.getOSUserName(address, host).trim();
>
>
>
>
> Username is one value not delimeted list
>
>
>
>
>         if ((OSUsername != null) && (OSUsername.length() > 0)) {
>
>           if (this.debug) {
>
>             System.out.println("Found user " + OSUsername + " on " +
> host);
>
>           }
>
>           OSUsername = OSUsername.toUpperCase();
>
>
>
> I think the above is Java?
>
>
>
> My client wants me to write a dll to replace the
> AXWin32Util.getOSUserName(address, host) method call.
>
>
>
> I don't have access to either the original source (dll) or the source
> to the calling app. Just the text above.
>
> If I create a COM dll called psdi.util.AXWin32Util.dll with a
> getOSUserName method and register it on the target server what are the
> chances it will work?
>
> I suspect the answer is zero.
>
>
>
> Dotnet is not allowed. No installation is allowed. The server is Win
> 2003 sp2.
>
>
>
> Ideas anyone?
>
>
>
> Cheers
>
>
>
> Michael
>
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
>
>



_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com

________________________________

No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1204 / Virus Database: 1435/3452 - Release Date: 02/18/11




More information about the dba-VB mailing list