Hi!
To create a new Windows account I use this code:
const int UF_PASSWD_CANT_ CHANGE = 0x0040;
const int UF_DONT_EXPIRE_ PASSWD = 0x10000;
DirectoryEntry obDirEntry = new DirectoryEntry( "WinNT://" + domain);
DirectoryEntrie s entries = obDirEntry.Chil dren;
DirectoryEntry obUser = entries.Add(use rname, "User");
obUser.Properti es["FullName"].Add(name);
obUser.Properti es["UserFlags"].Add(UF_PASSWD_ CANT_CHANGE |
UF_DONT_EXPIRE_ PASSWD);
if(homedir.Leng th>0)
obUser.Properti es["HomeDirect ory"].Add(homedir);
object obRet = obUser.Invoke(" SetPassword", password);
obUser.CommitCh anges();
My question is, is it possible to create a new windows account with a
certain SID?
In the case I wan't to replicate a user on another server.
Regards
Anders Aleborg
Aleborg Solutions
To create a new Windows account I use this code:
const int UF_PASSWD_CANT_ CHANGE = 0x0040;
const int UF_DONT_EXPIRE_ PASSWD = 0x10000;
DirectoryEntry obDirEntry = new DirectoryEntry( "WinNT://" + domain);
DirectoryEntrie s entries = obDirEntry.Chil dren;
DirectoryEntry obUser = entries.Add(use rname, "User");
obUser.Properti es["FullName"].Add(name);
obUser.Properti es["UserFlags"].Add(UF_PASSWD_ CANT_CHANGE |
UF_DONT_EXPIRE_ PASSWD);
if(homedir.Leng th>0)
obUser.Properti es["HomeDirect ory"].Add(homedir);
object obRet = obUser.Invoke(" SetPassword", password);
obUser.CommitCh anges();
My question is, is it possible to create a new windows account with a
certain SID?
In the case I wan't to replicate a user on another server.
Regards
Anders Aleborg
Aleborg Solutions
Comment