0

I would like, On Windows XP, that on login, it checks if the defaults user(for the company) exists, and if not, to create it.

Possible log off to connect as that user might be a cool option to add.

svick
  • 236,525
  • 50
  • 385
  • 514
Drew Salesse
  • 127
  • 1
  • 3
  • 18

1 Answers1

3

It think this code should help to find out if user exist (below code is for local machine):

var dirEntry =  new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer");
bool UserExists = (dirEntry.Children.Find(userIdentity, "user") != null);

About creating user you could look at: create local user account

Community
  • 1
  • 1
Piotr Stapp
  • 19,392
  • 11
  • 68
  • 116