473,382 Members | 1,480 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,382 software developers and data experts.

How get "log on locally" users and groups programatically?

Hi,

Spent nearly 8 hours googling and trying code on this yesterday without much
success. I'd like to write a .NET application (using .NET primitives, older
Win32 calls, or WMI etc) to work out which users can log onto a machine the
application is running on. The platforms I'd like to support are
NT/2000/XP - although 98 would be good too.

It looks like for 2000 and XP OS' the answer is listed in the "Local
Security Policy" control panel application under the "Local Policies/User
Rights Assignment/Log on locally" policy. However, after trying a lot of
"GetObject("winmgmts:\\.\root") (or \RSOP\Computer or \root\SECURITY)" type
calls I'm no further in actually getting at the list the Local Security
Policy displays - I'm not even sure which winmgmts namespace I should be
looking in (as rsop doesn't exist on 2000 or below).

Can someone point me towards a solution for getting this list of users that
can log on? I'd like a solution which doesn't rely on domains (like a
standalone PC), although clearly if a machine is in a domain I need to
handle it. Also, is this policy really the definitive answer I should be
looking at or is there an alternative (esp. for older OS')?

Thanks
Jonathan
Jul 19 '05 #1
0 2039

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

Similar topics

1
by: jerrygarciuh | last post by:
Hello, I am finding that on a new server where I am developing $_SERVER and $_SERVER Do not show up in $_SERVER when I when they should be defined I test using print_r($_SERVER) or this
0
by: Klemens | last post by:
what do entry's like this in db2diag.log indicate? ------------------------------------------- 2004-01-14-09.07.52.650000 Instance:WWS Node:000 PID:3512(db2syscs.exe) TID:1116 ...
6
by: Fan Ruo Xin | last post by:
Last monday, I tried to create a working table, and failed because of 'Log Full'. There were two applications running at that time - one is autoload (during the split phase), another one is "insert...
3
by: Phil Sherman | last post by:
What is the relationship between the snapshot elements: Log pages written Number write log IOs Number partial page log IOs There doesn't appear to be any information in my PDF System monitor...
1
by: Jonathan Trevor | last post by:
Thought I'd try some other newsgroups for a response... Thanks Jonathan > Hi, > > Spent nearly 8 hours googling and trying code on this yesterday without much > success. I'd like to write...
5
by: GaryDean | last post by:
Using 1.1.... I have an application using Forms Authentication that, like all other such applicaitons, uses FormsAuthentication.RedirectFromLoginPage to authenticate a user. at a point in time...
0
by: william | last post by:
Hi All, I'm using Microsoft logging library to log errors in my vb.net applications(web service). I put "Microsoft.Practices.EnterpriseLibrary.Logging.dll" into web.config file for codebase,...
0
by: yousefomar | last post by:
Hi Pros, I have a weird problem here. I am logging from my .NET app to a custom log, but unfortunately, the events are redirected to the Application log. I am sure that I am specifying the log...
2
by: TC | last post by:
I installed an ASP.NET application on my web server, but it doesn't work. When I browse to a page, I get an error message. The message doesn't say much, but it does tell me: An error message...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.