473,387 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Turning off user specific PC access based on stimulus?

Is there a way to log a non-administrative user off a PC or prevent them
from accessing the PC based on some external test? We can assume that the
OS is either Win 2k or Win XP.

TIA
Brad
Nov 21 '05 #1
6 1490
remove the non-administrative users ;-)

Nov 21 '05 #2
remove the non-administrative users ;-)

Nov 21 '05 #3
Hi

I agree with Nikolay's suggestion.
Also to logoff the current user, we can use the ExitWindowsEx API, if you
wants to logoff another user, e.g. you have the admin right on an terminal
server., we can use the WTSLogoffSession API.

If you wants to prevent certain user from logon, I think it would be better
to disable his account even delete the account.

If you still have any concern please feel free to post here.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #4
Peter and Nikolay,

Thank you for the responses, however I don't think that I've explained my
problem very clearly. What I'd like to do is programatically log off or
disable a user based on some critieria. Here's an example of what I'd like
to do: My son's bed time is 10:00 PM. At 10:00 PM he should log off of the
computer and go to bed. I'd like to run an application, possibly a windows
service, that keeps track of time then logs him off when it's time to go to
bed. This doesn't have any other impact on the current user other than to
log them off. Is this something that I can do via the ExitWindows API?

Thanks again.

Brad
""Peter Huang" [MSFT]" <v-******@online.microsoft.com> wrote in message
news:ac**************@cpmsftngxa10.phx.gbl...
Hi

I agree with Nikolay's suggestion.
Also to logoff the current user, we can use the ExitWindowsEx API, if you
wants to logoff another user, e.g. you have the admin right on an terminal
server., we can use the WTSLogoffSession API.

If you wants to prevent certain user from logon, I think it would be better to disable his account even delete the account.

If you still have any concern please feel free to post here.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #5
for this u can also use WTSLogoffSession API

it works on WIn XP

Nov 21 '05 #6
Hi

I agree with Nikolay's suggestion, because ExitWindowsEx API is used to log
off current user(The caller).

For detailed information, you may take a look at the MSDN.

The ExitWindowsEx function returns as soon as it has initiated the shutdown
process. The shutdown or logoff then proceeds asynchronously. The function
is designed to stop all processes in the caller's logon session. Therefore,
if you are not the interactive user, the function can succeed without
actually shutting down the computer.
ExitWindowsEx
http://msdn.microsoft.com/library/de...us/sysinfo/bas
e/exitwindowsex.asp

Also here is link about WTSLogoffSession in vb6, I think it will be
migrated to vb.net easier.
BTW: Long in vb6 means 32bit while in vb.net long means 64bit. So in the
vb.net you can use int32 to replace the long in vb6.

Monolithic TS API Wrapper
http://dev.remotenetworktechnology.com/api/wtsapi.htm

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bright | last post by:
Dear All I'm after a multi-User password database so that I can centrally store system passwords and give granular access to individuals based on their own unique authentication (possibly a...
60
by: Fotios | last post by:
Hi guys, I have put together a flexible client-side user agent detector (written in js). I thought that some of you may find it useful. Code is here: http://fotios.cc/software/ua_detect.htm ...
0
by: Chris Powell | last post by:
I am using Excel/Access 2000 and have two large Excel files (25,000 rows each) that I wish to create linked tables in Access rather than importing into Access. The two source Excel files change...
8
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As...
2
by: Fabrice | last post by:
Hello, I 'would like to build a system (based on database, not SqlServer but MySQL) to permit only one session per user. I'm using a form athentication. My Solution : --------------- When...
8
by: | last post by:
I'm looking for some design guidance on a collection of projects I'm working on. The project involves a bunch of websites constructed out of a collection of user controls. Different user...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
1
by: zlf | last post by:
Hello my website has role based access, and user without specific role assigned cannot access specific page in website. When the user try to access a page who has not been granted to access, the...
31
by: zdenko | last post by:
I have a multi user database and users were created by user level security wizzard - as I mentioned in message before. Everything works fine for those users, but now I have another problem. I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.