Does anyone know how to add users to the log on locally list in User
Rights Management inside Local Security settings.
Thanks 12 5312
Your question really has little to do with C# programming (that's the subject
of this group) but here goes:
open Local Security Settings from Administrative Tools, Computer Management
in Control Panel.
open the User Rights Assigment tree node.
Find the Log on Locally item in the Policy (right) window.
Double-click on this, and you can then add users or groups.
Next time, try to post to the relevant newsgroup. You're more likely to get
help.
--Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"ab************@gmail.com" wrote:
Does anyone know how to add users to the log on locally list in User
Rights Management inside Local Security settings.
Thanks
My apologies, you did say "programmatically". need to find the appropriate
WMI class to do this. For that, I can't help.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"ab************@gmail.com" wrote:
Does anyone know how to add users to the log on locally list in User
Rights Management inside Local Security settings.
Thanks
<ab************@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
Does anyone know how to add users to the log on locally list in User
Rights Management inside Local Security settings.
Thanks
All members of the "users", "administrators" and "guest" groups are
automatically allowed to log on locally. What other users were you thinking
off?
Willy.
well. I am required to create a function that automates the following
start -settings -control panel -administrative tools -local
security policy -user assignment rights -find 'log on
locally' (open up properties) -add users or workgroups to that list.
hope that makes my question clear.
thanks
Oh and I had test users in mind, so basically - "testuser1" for
example.
<ab************@gmail.comwrote in message
news:11********************@n59g2000hsh.googlegrou ps.com...
Oh and I had test users in mind, so basically - "testuser1" for
example.
Well, actually there is nothing in the Framework that helps you with this.
So you will have to call into some WIn32 LSA API's using PInvoke.
Basically what you need to do is:
1. Get a LSA Policy handle for the target system, by calling LsaOpenPolicy.
2. Get the SID of the user account, by calling LsaLookupNames2
3. Add the "SeInteractiveLogonRight" for the account, by means of a call to
LsaAddAccountRights.
Note that LSA_UNICODE_STRING type as used in these API's is not a CLR
string, it's a structure you need to initialize correctly before you call
the API's, watch out!.
But again, before you can grant this privilege to an account, the account
MUST exist, why not simply create the account and make it a member of the
"users" group or a group which already has the "Allow Logon Locally"
privilege"?
Willy.
Thanks for the response Willy.
My initial plan was to add the user to a workgroup that was pre-
existing in the list, but then those workgroups might have privleges
which I would not want the users I create to have.
<ab************@gmail.comwrote in message
news:11********************@o5g2000hsb.googlegroup s.com...
Thanks for the response Willy.
My initial plan was to add the user to a workgroup that was pre-
existing in the list, but then those workgroups might have privleges
which I would not want the users I create to have.
But you are talking about local accounts, I don't think you have tens of
these on a local machine don't you?
If you are running in a Windows domain, you can achieve what you want by
applying Group Policy Management.
Willy.
On May 8, 6:29 am, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.bewrote:
<abhishek.gi...@gmail.comwrote in message
news:11********************@n59g2000hsh.googlegrou ps.com...
Oh and I had testusersin mind, so basically - "testuser1" for
example.
Well, actually there is nothing in the Framework that helps you with this.
So you will have to call into some WIn32 LSA API's using PInvoke.
Basically what you need to do is:
1. Get a LSA Policy handle for the target system, by calling LsaOpenPolicy.
2. Get the SID of the user account, by calling LsaLookupNames2
3. Add the "SeInteractiveLogonRight" for the account, by means of a call to
LsaAddAccountRights.
Note that LSA_UNICODE_STRING type as used in these API's is not a CLR
string, it's a structure you need to initialize correctly before you call
the API's, watch out!.
But again, before you can grant this privilege to an account, the account
MUST exist, why not simply create the account and make it a member of the
"users" group or a group which already has the "Allow Logon Locally"
privilege"?
Willy.
I did that and it says -- "specified privilege does not exist" for
"SeInteractiveLogonRight"
<ab************@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
On May 8, 6:29 am, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.bewrote:
><abhishek.gi...@gmail.comwrote in message
news:11********************@n59g2000hsh.googlegro ups.com...
Oh and I had testusersin mind, so basically - "testuser1" for
example.
Well, actually there is nothing in the Framework that helps you with this. So you will have to call into some WIn32 LSA API's using PInvoke. Basically what you need to do is: 1. Get a LSA Policy handle for the target system, by calling LsaOpenPolicy. 2. Get the SID of the user account, by calling LsaLookupNames2 3. Add the "SeInteractiveLogonRight" for the account, by means of a call to LsaAddAccountRights. Note that LSA_UNICODE_STRING type as used in these API's is not a CLR string, it's a structure you need to initialize correctly before you call the API's, watch out!.
But again, before you can grant this privilege to an account, the account MUST exist, why not simply create the account and make it a member of the "users" group or a group which already has the "Allow Logon Locally" privilege"?
Willy.
I did that and it says -- "specified privilege does not exist" for
"SeInteractiveLogonRight"
"SeInteractiveLogonRight" should exist, could you please post some code.
Willy.
On May 8, 3:29 pm, abhishek.gi...@gmail.com wrote:
On May 8, 6:29 am, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.bewrote:
<abhishek.gi...@gmail.comwrote in message
news:11********************@n59g2000hsh.googlegrou ps.com...
Oh and I had testusersin mind, so basically - "testuser1" for
example.
Well, actually there is nothing in the Framework that helps you with this.
So you will have to call into some WIn32 LSA API's using PInvoke.
Basically what you need to do is:
1. Get a LSA Policy handle for the target system, by calling LsaOpenPolicy.
2. Get the SID of the user account, by calling LsaLookupNames2
3. Add the "SeInteractiveLogonRight" for the account, by means of a call to
LsaAddAccountRights.
Note that LSA_UNICODE_STRING type as used in these API's is not a CLR
string, it's a structure you need to initialize correctly before you call
the API's, watch out!.
But again, before you can grant this privilege to an account, the account
MUST exist, why not simply create the account and make it a member of the
"users" group or a group which already has the "Allow Logon Locally"
privilege"?
Willy.
I did that and it says -- "specified privilege does not exist" for
"SeInteractiveLogonRight"- Hide quoted text -
- Show quoted text -
whoops pressed the wrong button. Sorry about that
On May 9, 10:06 am, abhishek.gi...@gmail.com wrote:
On May 8, 3:29 pm, abhishek.gi...@gmail.com wrote:
On May 8, 6:29 am, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.bewrote:
<abhishek.gi...@gmail.comwrote in message
>news:11********************@n59g2000hsh.googlegro ups.com...
Oh and I had testusersin mind, so basically - "testuser1" for
example.
Well, actually there is nothing in the Framework that helps you with this.
So you will have to call into some WIn32 LSA API's using PInvoke.
Basically what you need to do is:
1. Get a LSA Policy handle for the target system, by calling LsaOpenPolicy.
2. Get the SID of the user account, by calling LsaLookupNames2
3. Add the "SeInteractiveLogonRight" for the account, by means of a call to
LsaAddAccountRights.
Note that LSA_UNICODE_STRING type as used in these API's is not a CLR
string, it's a structure you need to initialize correctly before you call
the API's, watch out!.
But again, before you can grant this privilege to an account, the account
MUST exist, why not simply create the account and make it a member of the
"users" group or a group which already has the "Allow Logon Locally"
privilege"?
Willy.
I did that and it says -- "specified privilege does not exist" for
"SeInteractiveLogonRight"- Hide quoted text -
- Show quoted text -
whoops pressed the wrong button. Sorry about that- Hide quoted text -
- Show quoted text -
Thanks for all the help. Never mind replying to my previous message.
It was a really stupid mistake. Its all working.
Thanks again! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jonathan Trevor |
last post by:
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...
|
by: CGuy |
last post by:
Hi,
I have an ASPX page which has a datagrid and this datagrid is bound to a
Custom Collection.
sample code
this.DataGrid1.DataSource = UserManager.Users;
this.DataGrid1.DataBind();
|
by: Ben Dewey |
last post by:
Project:
----------------------------
I am creating a HTTPS File Transfer App using ASP.NET and C#. I am
utilizing ActiveDirectory and windows security to manage the
permissions. Why reinvent...
|
by: Jim Heavey |
last post by:
Trying to figure out the technique which should be used
to add rows to a datagrid. I am thinking that I would
want an "Add" button on the footer, but I am not quite
sure how to do that. Is that...
|
by: enilno |
last post by:
I'm working on a C# app., and I need to programmatically add a local user to
a local group on the computer on which the app. is running. When end-users
run this app., they will be logged on as...
|
by: Prash |
last post by:
IIS serving javascript files, gives me error 4/21/2006 6:48 AM
Guys/Gals,
I am using IIS as a server to serve the javascript files. But it is
giving me the error as "Object doesn't support this...
|
by: ChrisCicc |
last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
|
by: jyothi.priya143 |
last post by:
Hi Friends,
Urgent Requirement for GENPACT is here for u now...
Here u can upload a soft copy of ur resume in one click...
Here U can also get Jobs-Freshers & Experienced, Sample Resumes,...
|
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$) {
}
...
|
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...
|
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
|
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...
|
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...
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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...
| |