dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 51

Thread: How to Detect if a Remote Computer is logged on?

  1. #31
    Ben Neville Guest

    Re: How to Detect if a Remote Computer is logged on?

    L.J.

    This is an interesting one that I am going to look at this some more so I
    can understand it better.

    I would agree that in a home/testing environment and for small businesses
    that people may use their account for services etc. For the majority of
    larger businesses this is normally not the case. In any case this does not
    appear to be the problem for you.

    Don't mean to make you walk upstairs again but when your computer first
    loads does that sid get loaded under HKEY_USERS before you log in? Does
    every user you use have this subkey hang around or just your regular user?
    It really should get unloaded entirely when you log out unless something
    else is using it. In my experience the normal thing that makes a SID hang
    around under HKEY_USERS are services but I will do some more digging as I
    want to understand what could be causing the profile to not unload
    correctly.

    I have used this method in the past successfully for a couple of major
    projects so if there is something that will cause it to break in Win2K I
    need to find a good new and simple solution.

    Tor,

    If this appears to work successfully for you you could run with it otherwise
    there is some more potential solutions being worked out on the other train
    of this thread.

    Ben

    "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote in message
    news:3b6f7663@news.devx.com...
    > Ben,
    >
    > > I have seen the same thing on NT 4.0. The only time I have seen this

    > happen
    > > is if you log on with an account which is also used for a service on the
    > > workstation. In this case the volatile environment subkey remains upon
    > > logging the interactive user out.

    >
    > <grumble, grumble, make me walk upstairs to check...>
    >
    > Nope, sorry. Not a single service as anything but local system.
    >
    > > In 99% of cases you will find that the accounts you use to log in
    > > interactively will be different to those that you use for services.

    >
    > Maybe, but not in my experience. On workstations, I often use my logon for
    > the SQL Server service.
    >
    > > When you
    > > log out and the account is not used anywhere else on the system (i.e.

    not
    > by
    > > a service) the subkey under HKEY_USERS for the particular users SID

    should
    > > disappear altogether.

    >
    > Well, mine didn't (after at least 4 hours of being logged out).
    >
    > --
    > L.J. Johnson, Slightly Tilted Software
    > Microsoft MVP (Visual Basic)
    > LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    > <http://www.SlightlyTiltedSoftware.com>
    > Ask The NT Pro at <http://www.devx.com/gethelp>
    >
    >
    >




  2. #32
    Tor Arne Nilsen Guest

    Re: How to Detect if a Remote Computer is logged on?

    Ben,

    There will be about 2-300 computers included in this. But it might work, at
    least worth testing. Depending on how much network traffic it will generate.

    Do you have any "nice" ideas on how to check for this on the remote
    computer? Witch API's let me check for registry keys on remote computers?

    Rgds

    Tor Arne Nilsen

    "Ben Neville" <bneville@programmer.net> wrote in message
    news:3b6f59d2@news.devx.com...
    > Tor,
    >
    > Depending on how the other half of this train works out I would think your
    > simplest method would be to have a component on the web server connect to
    > all the computers when someone requests that information. This would

    however
    > be entirly dependant upon how many computers you have to talk to but if

    its
    > less than 100 or so I think it would be your easiest approach.
    >
    > Rgds
    > Ben
    >
    > "Tor Arne Nilsen" <tor.arne.nilsen@vbsoftdev.net> wrote in message
    > news:3b6bcfb6@news.devx.com...
    > > Ben,
    > > The plan with the project is to finally get a WEB Page to display witch
    > > computers that are in use and witch that is free. It is supposed to be

    > used
    > > in a Education Organization that will be providing it as a extra service

    > for
    > > the students. I wan't them to be able to see if there is computers that

    > are
    > > available for them or if all computers are in use for the moment.
    > >
    > > I know that there is some pearl code out there that can do this but

    > finding
    > > it is not to eazy, and specialy when i don't know anything about pearl.
    > >
    > > Rgds
    > > Tor Arne Nilsen
    > >
    > > "Ben Neville" <bneville@programmer.net> wrote in message
    > > news:3b6b62e8@news.devx.com...
    > > > Tor,
    > > >
    > > > If you provide a clear description of what you are looking to achieve

    we
    > > > could give a better recommendation here.
    > > >
    > > > E.G. If you want to create a program to use on a supervisor type

    > computer
    > > > that you can run on demand then why not just create a program that

    > > connects
    > > > to each PC in turn and then returns the results. This could be via a

    web
    > > > page.
    > > > If you want code that sits there and constantly updates with machines

    as
    > > > they become free you could use a service type approach which would run

    > on
    > > > each PC and then make some sort of notification call to supervisor
    > > > application which shows where the free seats are when a seat changes

    > > status.
    > > > I would think this is significantly more work but it would probably

    > scale
    > > > better if you want to monitor hundreds of PCs.
    > > >
    > > > Let us know the scope of the problems and the desired behaviour of you

    > are
    > > > looking to achieve so we can advise what approach would work best.
    > > >
    > > > Rgds
    > > > Ben
    > > >
    > > > "Tor Arne Nilsen" <tor.arne.nilsen@vbsoftdev.net> wrote in message
    > > > news:3b6a3e14@news.devx.com...
    > > > > Ben,
    > > > >
    > > > > It looks like this will work. I have bin going through the

    HKEY_USERS
    > > and
    > > > it
    > > > > is the same as in NT4.0.
    > > > > Is there a eazy way to implement this check as a service on a

    > > WinNT/Win2K
    > > > > computer. Implementation of this as a DLL should not be so hard, but

    > the
    > > > > eazyest way to do this should be through a service. But im not shure

    > how
    > > I
    > > > > should get this to work.
    > > > >
    > > > > Any ideas?
    > > > >
    > > > > Rgds,
    > > > > Tor Arne Nilsen
    > > > >
    > > > >
    > > > > "Ben Neville" <bneville@programmer.net> wrote in message
    > > > > news:3b6a0d27$1@news.devx.com...
    > > > > > Tor,
    > > > > >
    > > > > > Here is one possibility.
    > > > > >
    > > > > > Enumerate the registry sub keys (SIDS) contained under HKEY_USERS.

    > In
    > > > each
    > > > > > sub key look for a key called "Volatile Environment".
    > > > > >
    > > > > > Those with this value should belong to interactively logged on

    > users.
    > > > > Those
    > > > > > without this key are normally service or batch jobs.
    > > > > >
    > > > > > Hence if you find a volatile environment section there would

    > normally
    > > be
    > > > > an
    > > > > > interactively logged on user. This can easily be done remotely.
    > > > > >
    > > > > > From what I have seen this works on NT4.0. I am not 100 % sure

    about
    > > on
    > > > > > Win2K but it could be worth a shot.
    > > > > >
    > > > > > Rgds
    > > > > > Ben
    > > > > >
    > > > > >
    > > > > > "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote in

    > message
    > > > > > news:3b696b4b@news.devx.com...
    > > > > > > Tor,
    > > > > > >
    > > > > > > > Is there a way to check if a remote Win2K computer is logged

    on?
    > > > > > > > The purpose is to see if computers are ocupied or if they are

    > > "free"
    > > > > for
    > > > > > > > access...
    > > > > > >
    > > > > > > I don't know of a way. If you had a small ActiveX exe running on

    > > each
    > > > > > > machine, I can think of a couple of possibilities. And, the
    > > > > > NetWkstaUserEnum
    > > > > > > looks interesting (I haven't used this particular API) --
    > > > > > >
    > > > > > > "The NetWkstaUserEnum function lists information about all users
    > > > > currently
    > > > > > > logged on to the workstation. This list includes interactive,

    > > service
    > > > > and
    > > > > > > batch logons."
    > > > > > >
    > > > > > > However, it doesn't give a way to distinguish between the

    various
    > > > users.
    > > > > > > Bummer.
    > > > > > >
    > > > > > > --
    > > > > > > L.J. Johnson, Slightly Tilted Software
    > > > > > > Microsoft MVP (Visual Basic)
    > > > > > > LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    > > > > > > <http://www.SlightlyTiltedSoftware.com>
    > > > > > > Ask The NT Pro at <http://www.devx.com/gethelp>
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >




  3. #33
    Tor Arne Nilsen Guest

    Re: How to Detect if a Remote Computer is logged on?

    Ben,

    There will be about 2-300 computers included in this. But it might work, at
    least worth testing. Depending on how much network traffic it will generate.

    Do you have any "nice" ideas on how to check for this on the remote
    computer? Witch API's let me check for registry keys on remote computers?

    Rgds

    Tor Arne Nilsen

    "Ben Neville" <bneville@programmer.net> wrote in message
    news:3b6f59d2@news.devx.com...
    > Tor,
    >
    > Depending on how the other half of this train works out I would think your
    > simplest method would be to have a component on the web server connect to
    > all the computers when someone requests that information. This would

    however
    > be entirly dependant upon how many computers you have to talk to but if

    its
    > less than 100 or so I think it would be your easiest approach.
    >
    > Rgds
    > Ben
    >
    > "Tor Arne Nilsen" <tor.arne.nilsen@vbsoftdev.net> wrote in message
    > news:3b6bcfb6@news.devx.com...
    > > Ben,
    > > The plan with the project is to finally get a WEB Page to display witch
    > > computers that are in use and witch that is free. It is supposed to be

    > used
    > > in a Education Organization that will be providing it as a extra service

    > for
    > > the students. I wan't them to be able to see if there is computers that

    > are
    > > available for them or if all computers are in use for the moment.
    > >
    > > I know that there is some pearl code out there that can do this but

    > finding
    > > it is not to eazy, and specialy when i don't know anything about pearl.
    > >
    > > Rgds
    > > Tor Arne Nilsen
    > >
    > > "Ben Neville" <bneville@programmer.net> wrote in message
    > > news:3b6b62e8@news.devx.com...
    > > > Tor,
    > > >
    > > > If you provide a clear description of what you are looking to achieve

    we
    > > > could give a better recommendation here.
    > > >
    > > > E.G. If you want to create a program to use on a supervisor type

    > computer
    > > > that you can run on demand then why not just create a program that

    > > connects
    > > > to each PC in turn and then returns the results. This could be via a

    web
    > > > page.
    > > > If you want code that sits there and constantly updates with machines

    as
    > > > they become free you could use a service type approach which would run

    > on
    > > > each PC and then make some sort of notification call to supervisor
    > > > application which shows where the free seats are when a seat changes

    > > status.
    > > > I would think this is significantly more work but it would probably

    > scale
    > > > better if you want to monitor hundreds of PCs.
    > > >
    > > > Let us know the scope of the problems and the desired behaviour of you

    > are
    > > > looking to achieve so we can advise what approach would work best.
    > > >
    > > > Rgds
    > > > Ben
    > > >
    > > > "Tor Arne Nilsen" <tor.arne.nilsen@vbsoftdev.net> wrote in message
    > > > news:3b6a3e14@news.devx.com...
    > > > > Ben,
    > > > >
    > > > > It looks like this will work. I have bin going through the

    HKEY_USERS
    > > and
    > > > it
    > > > > is the same as in NT4.0.
    > > > > Is there a eazy way to implement this check as a service on a

    > > WinNT/Win2K
    > > > > computer. Implementation of this as a DLL should not be so hard, but

    > the
    > > > > eazyest way to do this should be through a service. But im not shure

    > how
    > > I
    > > > > should get this to work.
    > > > >
    > > > > Any ideas?
    > > > >
    > > > > Rgds,
    > > > > Tor Arne Nilsen
    > > > >
    > > > >
    > > > > "Ben Neville" <bneville@programmer.net> wrote in message
    > > > > news:3b6a0d27$1@news.devx.com...
    > > > > > Tor,
    > > > > >
    > > > > > Here is one possibility.
    > > > > >
    > > > > > Enumerate the registry sub keys (SIDS) contained under HKEY_USERS.

    > In
    > > > each
    > > > > > sub key look for a key called "Volatile Environment".
    > > > > >
    > > > > > Those with this value should belong to interactively logged on

    > users.
    > > > > Those
    > > > > > without this key are normally service or batch jobs.
    > > > > >
    > > > > > Hence if you find a volatile environment section there would

    > normally
    > > be
    > > > > an
    > > > > > interactively logged on user. This can easily be done remotely.
    > > > > >
    > > > > > From what I have seen this works on NT4.0. I am not 100 % sure

    about
    > > on
    > > > > > Win2K but it could be worth a shot.
    > > > > >
    > > > > > Rgds
    > > > > > Ben
    > > > > >
    > > > > >
    > > > > > "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote in

    > message
    > > > > > news:3b696b4b@news.devx.com...
    > > > > > > Tor,
    > > > > > >
    > > > > > > > Is there a way to check if a remote Win2K computer is logged

    on?
    > > > > > > > The purpose is to see if computers are ocupied or if they are

    > > "free"
    > > > > for
    > > > > > > > access...
    > > > > > >
    > > > > > > I don't know of a way. If you had a small ActiveX exe running on

    > > each
    > > > > > > machine, I can think of a couple of possibilities. And, the
    > > > > > NetWkstaUserEnum
    > > > > > > looks interesting (I haven't used this particular API) --
    > > > > > >
    > > > > > > "The NetWkstaUserEnum function lists information about all users
    > > > > currently
    > > > > > > logged on to the workstation. This list includes interactive,

    > > service
    > > > > and
    > > > > > > batch logons."
    > > > > > >
    > > > > > > However, it doesn't give a way to distinguish between the

    various
    > > > users.
    > > > > > > Bummer.
    > > > > > >
    > > > > > > --
    > > > > > > L.J. Johnson, Slightly Tilted Software
    > > > > > > Microsoft MVP (Visual Basic)
    > > > > > > LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    > > > > > > <http://www.SlightlyTiltedSoftware.com>
    > > > > > > Ask The NT Pro at <http://www.devx.com/gethelp>
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >




  4. #34
    Tor Arne Nilsen Guest

    Re: How to Detect if a Remote Computer is logged on?

    Ben,

    I have tested this localy on my computer for now, and it looks like it works
    fine. I have some problems implement it to the network. Have problems enum
    the registry on a remote computers, any ideas on how to "attack" this
    problem?

    Rgds,
    Tor Arne Nilsen

    "Ben Neville" <bneville@programmer.net> wrote in message
    news:3b6fe73f$1@news.devx.com...
    > L.J.
    >
    > This is an interesting one that I am going to look at this some more so I
    > can understand it better.
    >
    > I would agree that in a home/testing environment and for small businesses
    > that people may use their account for services etc. For the majority of
    > larger businesses this is normally not the case. In any case this does not
    > appear to be the problem for you.
    >
    > Don't mean to make you walk upstairs again but when your computer first
    > loads does that sid get loaded under HKEY_USERS before you log in? Does
    > every user you use have this subkey hang around or just your regular user?
    > It really should get unloaded entirely when you log out unless something
    > else is using it. In my experience the normal thing that makes a SID hang
    > around under HKEY_USERS are services but I will do some more digging as I
    > want to understand what could be causing the profile to not unload
    > correctly.
    >
    > I have used this method in the past successfully for a couple of major
    > projects so if there is something that will cause it to break in Win2K I
    > need to find a good new and simple solution.
    >
    > Tor,
    >
    > If this appears to work successfully for you you could run with it

    otherwise
    > there is some more potential solutions being worked out on the other train
    > of this thread.
    >
    > Ben
    >
    > "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote in message
    > news:3b6f7663@news.devx.com...
    > > Ben,
    > >
    > > > I have seen the same thing on NT 4.0. The only time I have seen this

    > > happen
    > > > is if you log on with an account which is also used for a service on

    the
    > > > workstation. In this case the volatile environment subkey remains upon
    > > > logging the interactive user out.

    > >
    > > <grumble, grumble, make me walk upstairs to check...>
    > >
    > > Nope, sorry. Not a single service as anything but local system.
    > >
    > > > In 99% of cases you will find that the accounts you use to log in
    > > > interactively will be different to those that you use for services.

    > >
    > > Maybe, but not in my experience. On workstations, I often use my logon

    for
    > > the SQL Server service.
    > >
    > > > When you
    > > > log out and the account is not used anywhere else on the system (i.e.

    > not
    > > by
    > > > a service) the subkey under HKEY_USERS for the particular users SID

    > should
    > > > disappear altogether.

    > >
    > > Well, mine didn't (after at least 4 hours of being logged out).
    > >
    > > --
    > > L.J. Johnson, Slightly Tilted Software
    > > Microsoft MVP (Visual Basic)
    > > LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    > > <http://www.SlightlyTiltedSoftware.com>
    > > Ask The NT Pro at <http://www.devx.com/gethelp>
    > >
    > >
    > >

    >
    >




  5. #35
    Tor Arne Nilsen Guest

    Re: How to Detect if a Remote Computer is logged on?

    Ben,

    I have tested this localy on my computer for now, and it looks like it works
    fine. I have some problems implement it to the network. Have problems enum
    the registry on a remote computers, any ideas on how to "attack" this
    problem?

    Rgds,
    Tor Arne Nilsen

    "Ben Neville" <bneville@programmer.net> wrote in message
    news:3b6fe73f$1@news.devx.com...
    > L.J.
    >
    > This is an interesting one that I am going to look at this some more so I
    > can understand it better.
    >
    > I would agree that in a home/testing environment and for small businesses
    > that people may use their account for services etc. For the majority of
    > larger businesses this is normally not the case. In any case this does not
    > appear to be the problem for you.
    >
    > Don't mean to make you walk upstairs again but when your computer first
    > loads does that sid get loaded under HKEY_USERS before you log in? Does
    > every user you use have this subkey hang around or just your regular user?
    > It really should get unloaded entirely when you log out unless something
    > else is using it. In my experience the normal thing that makes a SID hang
    > around under HKEY_USERS are services but I will do some more digging as I
    > want to understand what could be causing the profile to not unload
    > correctly.
    >
    > I have used this method in the past successfully for a couple of major
    > projects so if there is something that will cause it to break in Win2K I
    > need to find a good new and simple solution.
    >
    > Tor,
    >
    > If this appears to work successfully for you you could run with it

    otherwise
    > there is some more potential solutions being worked out on the other train
    > of this thread.
    >
    > Ben
    >
    > "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote in message
    > news:3b6f7663@news.devx.com...
    > > Ben,
    > >
    > > > I have seen the same thing on NT 4.0. The only time I have seen this

    > > happen
    > > > is if you log on with an account which is also used for a service on

    the
    > > > workstation. In this case the volatile environment subkey remains upon
    > > > logging the interactive user out.

    > >
    > > <grumble, grumble, make me walk upstairs to check...>
    > >
    > > Nope, sorry. Not a single service as anything but local system.
    > >
    > > > In 99% of cases you will find that the accounts you use to log in
    > > > interactively will be different to those that you use for services.

    > >
    > > Maybe, but not in my experience. On workstations, I often use my logon

    for
    > > the SQL Server service.
    > >
    > > > When you
    > > > log out and the account is not used anywhere else on the system (i.e.

    > not
    > > by
    > > > a service) the subkey under HKEY_USERS for the particular users SID

    > should
    > > > disappear altogether.

    > >
    > > Well, mine didn't (after at least 4 hours of being logged out).
    > >
    > > --
    > > L.J. Johnson, Slightly Tilted Software
    > > Microsoft MVP (Visual Basic)
    > > LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    > > <http://www.SlightlyTiltedSoftware.com>
    > > Ask The NT Pro at <http://www.devx.com/gethelp>
    > >
    > >
    > >

    >
    >




  6. #36
    L.J. Johnson Guest

    Re: How to Detect if a Remote Computer is logged on?

    Tor,

    > I have tested this locally on my computer for now, and it looks like it

    works
    > fine. I have some problems implement it to the network. Have problems enum
    > the registry on a remote computers, any ideas on how to "attack" this
    > problem?


    Basically, the process is the exactly the same. There is one extra step,
    calling RegConnectRegistry to connect to the remote registry (and you can
    only connect to HKEY_LOCAL_MACHINE or HKEY_USERS). And, of course, you must
    have rights to the appropriate parts of the registry on the remote machine.
    Using this key instead of the constant for HKEY_USERS, you would enumerate
    the keys the same as on the local machine.

    Private Const HKEY_USERS As Long = &H80000003

    Private Declare Function RegConnectRegistry _
    Lib "advapi32.dll" Alias "RegConnectRegistryA" _
    (ByVal lpMachineName As String, _
    ByVal hKey As Long, _
    phkResult As Long) As Long

    Dim p_lngRtn As Long
    Dim p_lngUsersKey As Long

    p_lngRtn = RegConnectRegistry(lpMachineName:=xi_strComputerName, _
    hKey:=HKEY_USERS, _
    phkResult:=p_lngUsersKey)
    If p_lngRtn <> ERROR_SUCCESS Then
    GetRemoteKey = 0
    Else
    GetRemoteKey = p_lngUsersKey
    End If

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>




  7. #37
    L.J. Johnson Guest

    Re: How to Detect if a Remote Computer is logged on?

    Tor,

    > I have tested this locally on my computer for now, and it looks like it

    works
    > fine. I have some problems implement it to the network. Have problems enum
    > the registry on a remote computers, any ideas on how to "attack" this
    > problem?


    Basically, the process is the exactly the same. There is one extra step,
    calling RegConnectRegistry to connect to the remote registry (and you can
    only connect to HKEY_LOCAL_MACHINE or HKEY_USERS). And, of course, you must
    have rights to the appropriate parts of the registry on the remote machine.
    Using this key instead of the constant for HKEY_USERS, you would enumerate
    the keys the same as on the local machine.

    Private Const HKEY_USERS As Long = &H80000003

    Private Declare Function RegConnectRegistry _
    Lib "advapi32.dll" Alias "RegConnectRegistryA" _
    (ByVal lpMachineName As String, _
    ByVal hKey As Long, _
    phkResult As Long) As Long

    Dim p_lngRtn As Long
    Dim p_lngUsersKey As Long

    p_lngRtn = RegConnectRegistry(lpMachineName:=xi_strComputerName, _
    hKey:=HKEY_USERS, _
    phkResult:=p_lngUsersKey)
    If p_lngRtn <> ERROR_SUCCESS Then
    GetRemoteKey = 0
    Else
    GetRemoteKey = p_lngUsersKey
    End If

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>




  8. #38
    L.J. Johnson Guest

    Re: How to Detect if a Remote Computer is logged on?

    Ben,

    > I would agree that in a home/testing environment and for small businesses
    > that people may use their account for services etc. For the majority of
    > larger businesses this is normally not the case. In any case this does not
    > appear to be the problem for you.


    Well, I've done this on my *development* machine at many large corps, and as
    have many other developers I've worked with. However, developers are not
    "normal" people, nor are their machines normal <g>.

    > Don't mean to make you walk upstairs again but when your computer first
    > loads does that sid get loaded under HKEY_USERS before you log in?


    Curious. Not, it doesn't. In fact, that user isn't even listed under
    HKEY_USERS. Nor is the other user for that machine. The only "user" listed
    is the .Default user.

    So, apparently, once you've logged in (under W2K workstation), that user
    remains (at least for 4 hours ...) under the HKEY_USERS until you logoff.

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>




  9. #39
    L.J. Johnson Guest

    Re: How to Detect if a Remote Computer is logged on?

    Ben,

    > I would agree that in a home/testing environment and for small businesses
    > that people may use their account for services etc. For the majority of
    > larger businesses this is normally not the case. In any case this does not
    > appear to be the problem for you.


    Well, I've done this on my *development* machine at many large corps, and as
    have many other developers I've worked with. However, developers are not
    "normal" people, nor are their machines normal <g>.

    > Don't mean to make you walk upstairs again but when your computer first
    > loads does that sid get loaded under HKEY_USERS before you log in?


    Curious. Not, it doesn't. In fact, that user isn't even listed under
    HKEY_USERS. Nor is the other user for that machine. The only "user" listed
    is the .Default user.

    So, apparently, once you've logged in (under W2K workstation), that user
    remains (at least for 4 hours ...) under the HKEY_USERS until you logoff.

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>




  10. #40
    Tor Arne Nilsen Guest

    Re: How to Detect if a Remote Computer is logged on?

    I've runned som tests here on 3 Win2K Computers
    2 in a Win2K Domain environment, and 1 standalone Win2K Computer. In both
    cases the Enum of HKEY_USERS returned all the user accounts currentley
    logged on to the workstation. Under this the .Default, all service accounts,
    and regular users was listed.
    I enabled the application as a service and I got "perfect" results. While I
    was logged in the "log" show that the "Volatile Environment" was in place
    for the logged on user. When I logg off none of the users listed in the
    HKEY_USERS had the "Volatile Environment" key. So it looks like it is ok.
    Im not shure if this problem L.J, talks about is because of some security
    settings or other computer configurations. But it looks like the HKEY_USERS
    is 100% updated at all time.

    Rgds,
    Tor Arne..


    "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote in message
    news:3b700d4e@news.devx.com...
    > Ben,
    >
    > > I would agree that in a home/testing environment and for small

    businesses
    > > that people may use their account for services etc. For the majority of
    > > larger businesses this is normally not the case. In any case this does

    not
    > > appear to be the problem for you.

    >
    > Well, I've done this on my *development* machine at many large corps, and

    as
    > have many other developers I've worked with. However, developers are not
    > "normal" people, nor are their machines normal <g>.
    >
    > > Don't mean to make you walk upstairs again but when your computer first
    > > loads does that sid get loaded under HKEY_USERS before you log in?

    >
    > Curious. Not, it doesn't. In fact, that user isn't even listed under
    > HKEY_USERS. Nor is the other user for that machine. The only "user" listed
    > is the .Default user.
    >
    > So, apparently, once you've logged in (under W2K workstation), that user
    > remains (at least for 4 hours ...) under the HKEY_USERS until you logoff.
    >
    > --
    > L.J. Johnson, Slightly Tilted Software
    > Microsoft MVP (Visual Basic)
    > LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    > <http://www.SlightlyTiltedSoftware.com>
    > Ask The NT Pro at <http://www.devx.com/gethelp>
    >
    >
    >




  11. #41
    Tor Arne Nilsen Guest

    Re: How to Detect if a Remote Computer is logged on?

    I've runned som tests here on 3 Win2K Computers
    2 in a Win2K Domain environment, and 1 standalone Win2K Computer. In both
    cases the Enum of HKEY_USERS returned all the user accounts currentley
    logged on to the workstation. Under this the .Default, all service accounts,
    and regular users was listed.
    I enabled the application as a service and I got "perfect" results. While I
    was logged in the "log" show that the "Volatile Environment" was in place
    for the logged on user. When I logg off none of the users listed in the
    HKEY_USERS had the "Volatile Environment" key. So it looks like it is ok.
    Im not shure if this problem L.J, talks about is because of some security
    settings or other computer configurations. But it looks like the HKEY_USERS
    is 100% updated at all time.

    Rgds,
    Tor Arne..


    "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote in message
    news:3b700d4e@news.devx.com...
    > Ben,
    >
    > > I would agree that in a home/testing environment and for small

    businesses
    > > that people may use their account for services etc. For the majority of
    > > larger businesses this is normally not the case. In any case this does

    not
    > > appear to be the problem for you.

    >
    > Well, I've done this on my *development* machine at many large corps, and

    as
    > have many other developers I've worked with. However, developers are not
    > "normal" people, nor are their machines normal <g>.
    >
    > > Don't mean to make you walk upstairs again but when your computer first
    > > loads does that sid get loaded under HKEY_USERS before you log in?

    >
    > Curious. Not, it doesn't. In fact, that user isn't even listed under
    > HKEY_USERS. Nor is the other user for that machine. The only "user" listed
    > is the .Default user.
    >
    > So, apparently, once you've logged in (under W2K workstation), that user
    > remains (at least for 4 hours ...) under the HKEY_USERS until you logoff.
    >
    > --
    > L.J. Johnson, Slightly Tilted Software
    > Microsoft MVP (Visual Basic)
    > LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    > <http://www.SlightlyTiltedSoftware.com>
    > Ask The NT Pro at <http://www.devx.com/gethelp>
    >
    >
    >




  12. #42
    Tor Arne Nilsen Guest

    Re: How to Detect if a Remote Computer is logged on?

    I want to thank you all for the help with this problem.

    It looks like the solution will be as follows.
    Enum the registry on all computers from one computer using the
    RegConnectRegistry API. on the HKEY_USERS, looking through every subkey for
    Volatile Environment after what I can see this solution works fine, and the
    network load and the load on the server is kept on a minimum.

    So thanks to you all..

    Rgds,
    Tor Arne Nilsen

    "Tor Arne Nilsen" <tor.arne.nilsen@vbsoftdev.net> wrote in message
    news:3b67ef4b@news.devx.com...
    > Is there a way to check if a remote Win2K computer is logged on?
    > The purpose is to see if computers are ocupied or if they are "free" for
    > access...
    >
    >
    >
    >




  13. #43
    Tor Arne Nilsen Guest

    Re: How to Detect if a Remote Computer is logged on?

    I want to thank you all for the help with this problem.

    It looks like the solution will be as follows.
    Enum the registry on all computers from one computer using the
    RegConnectRegistry API. on the HKEY_USERS, looking through every subkey for
    Volatile Environment after what I can see this solution works fine, and the
    network load and the load on the server is kept on a minimum.

    So thanks to you all..

    Rgds,
    Tor Arne Nilsen

    "Tor Arne Nilsen" <tor.arne.nilsen@vbsoftdev.net> wrote in message
    news:3b67ef4b@news.devx.com...
    > Is there a way to check if a remote Win2K computer is logged on?
    > The purpose is to see if computers are ocupied or if they are "free" for
    > access...
    >
    >
    >
    >




  14. #44
    Ben Neville Guest

    Re: How to Detect if a Remote Computer is logged on?

    Tor,

    If this ever gives inaccurate results you could potentially also go to an
    approach of just seeing if there is an explorer.exe in the process list.
    There obviously could be times when this would give false positives but it
    is one other possible approach.

    Rgds
    Ben

    "Tor Arne Nilsen" <tor.arne.nilsen@vbsoftdev.net> wrote in message
    news:3b719eaf@news.devx.com...
    > I want to thank you all for the help with this problem.
    >
    > It looks like the solution will be as follows.
    > Enum the registry on all computers from one computer using the
    > RegConnectRegistry API. on the HKEY_USERS, looking through every subkey

    for
    > Volatile Environment after what I can see this solution works fine, and

    the
    > network load and the load on the server is kept on a minimum.
    >
    > So thanks to you all..
    >
    > Rgds,
    > Tor Arne Nilsen
    >
    > "Tor Arne Nilsen" <tor.arne.nilsen@vbsoftdev.net> wrote in message
    > news:3b67ef4b@news.devx.com...
    > > Is there a way to check if a remote Win2K computer is logged on?
    > > The purpose is to see if computers are ocupied or if they are "free" for
    > > access...
    > >
    > >
    > >
    > >

    >
    >




  15. #45
    Ben Neville Guest

    Re: How to Detect if a Remote Computer is logged on?

    Tor,

    If this ever gives inaccurate results you could potentially also go to an
    approach of just seeing if there is an explorer.exe in the process list.
    There obviously could be times when this would give false positives but it
    is one other possible approach.

    Rgds
    Ben

    "Tor Arne Nilsen" <tor.arne.nilsen@vbsoftdev.net> wrote in message
    news:3b719eaf@news.devx.com...
    > I want to thank you all for the help with this problem.
    >
    > It looks like the solution will be as follows.
    > Enum the registry on all computers from one computer using the
    > RegConnectRegistry API. on the HKEY_USERS, looking through every subkey

    for
    > Volatile Environment after what I can see this solution works fine, and

    the
    > network load and the load on the server is kept on a minimum.
    >
    > So thanks to you all..
    >
    > Rgds,
    > Tor Arne Nilsen
    >
    > "Tor Arne Nilsen" <tor.arne.nilsen@vbsoftdev.net> wrote in message
    > news:3b67ef4b@news.devx.com...
    > > Is there a way to check if a remote Win2K computer is logged on?
    > > The purpose is to see if computers are ocupied or if they are "free" for
    > > access...
    > >
    > >
    > >
    > >

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center