Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - I would like to use Win32_LogonSession but it is confusing to me.

Reply
 
Old 02-18-2009   #1 (permalink)
freddy


 
 

I would like to use Win32_LogonSession but it is confusing to me.

I would like to find out if a computer is in the locked computer state, is he
or she currently using it or is it in the loin prompt waiting for some one to
login. The problem is that I do not have access to te login script or AD.

My System SpecsSystem Spec
Old 02-18-2009   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: I would like to use Win32_LogonSession but it is confusing to me.


"freddy" <freddy@xxxxxx> wrote in message
news:E18E435F-55F5-4B81-88D6-2D02527D990C@xxxxxx
Quote:

>I would like to find out if a computer is in the locked computer state, is
>he
> or she currently using it or is it in the loin prompt waiting for some one
> to
> login. The problem is that I do not have access to te login script or AD.
From the Microsoft Script Center an example using the Win32_LogonSession
class:

http://www.microsoft.com/technet/scr.../dmlgvb01.mspx

To retrieve the name of the user currently logged into the computer:

http://www.microsoft.com/technet/scr.../dmlgvb02.mspx

In both cases assign the NetBIOS name of the remote computer to the variable
strComputer. If strComputer = "." that means the computer you are using. I
don't know how to tell if the machine is in a locked state.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 02-18-2009   #3 (permalink)
Al Dunbar


 
 

Re: I would like to use Win32_LogonSession but it is confusing to me.


"freddy" <freddy@xxxxxx> wrote in message
news:E18E435F-55F5-4B81-88D6-2D02527D990C@xxxxxx
Quote:

>I would like to find out if a computer is in the locked computer state, is
>he
> or she currently using it or is it in the loin prompt waiting for some one
> to
> login. The problem is that I do not have access to te login script or AD.
That's no problem. Neither the logon script nor AD have any clue as to what
state a workstation might happen to be in.

That said, I have little knowledge of win32_logonsession, however, I'd
suggest you write a script to display the values assigned to at least the
more suggestive properties, like logontype, name, starttime, and status. If
you cannot deduce what you are looking for from that, then perhaps it is not
deduceable.


/Al


My System SpecsSystem Spec
Old 02-19-2009   #4 (permalink)
BigDaddyJim


 
 

Re: I would like to use Win32_LogonSession but it is confusing to me.

On Feb 18, 8:18*pm, "Al Dunbar" <aland...@xxxxxx> wrote:
Quote:

> "freddy" <fre...@xxxxxx> wrote in message
>
> news:E18E435F-55F5-4B81-88D6-2D02527D990C@xxxxxx
>
Quote:

> >I would like to find out if a computer is in the locked computer state, is
> >he
> > or she currently using it or is it in the loin prompt waiting for some one
> > to
> > login. The problem is that I do not have access to te login script or AD.
>
> That's no problem. Neither the logon script nor AD have any clue as to what
> state a workstation might happen to be in.
>
> That said, I have little knowledge of win32_logonsession, however, I'd
> suggest you write a script to display the values assigned to at least the
> more suggestive properties, like logontype, name, starttime, and status. If
> you cannot deduce what you are looking for from that, then perhaps it is not
> deduceable.
>
> /Al
You may want to check for a currently logged-on user using the
Win32_ComputerSystem class and then, subsequently if there is a user
logged on, check for a process named .SCR using the WIN32_Process WMI
class. This would indicate that the system is locked, if your power
management group policy requires locking after a given amount of time.

Jim

Jim
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
GPU-z confusing readout Graphic cards
Confusing prompt for a [bool] value (V2 CTP) PowerShell
Windows Firewall Confusing Vista security
Confusing error on NetworkInformation PowerShell
Confusing exception trapping behaviour PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46