Friday, 21 May 2010

Programmatically grant user privileges

When installing services, in particular SQL Server, it is a frequent requirement to create a service user and assign certain rights. To assist users during installation it is helpful to gather the required information (e.g. username + password) amd programmatically create the user for them. To achieve this you will need to create the user, assign it to the appropriate groups and grant any specific rights. Granting privileges and impersonation is covered in Corinna John's CodeProject article:
How to add a user to the local system using C#:
How to add a user to the domain using C#:

No comments: