Configure Properties of Windows User (Terminal Server Eviroment)

  • Thread starter Thread starter Tatiana
  • Start date Start date
T

Tatiana

Hi All,

I created a windows user with vbnet, with the instructions of the code:

http://www.microsoft.com/communitie...t=en-us-msdn&lang=en&cr=US&sloc=en-us&m=1&p=1

but now, i need configure the options with vbnet:

In the properties of user:
label: the Profile of Terminal Server Services, i need configure the
path of homedir with a value. for example ("C:\myDir")

And

label: in the option ("Entorno") Enviroment, i need check the option
"Iniciar el programa siguiente al iniciar sesión" is like Begin
the follow programa in the session. In this same option i need set the
values: "Iniciar en" and "Nombre de archivo de programas" is like "Begin
in" and "Name of file of programs".


I reviewed the all values of flags (of the link), and i cant, i think may
be, i need a terminal server libraries, but i dont know, please helpme, and
sorry for the values in spanish, i have OS only in spanish.
 
Using Terminal server should not be a part of vb but about the way the
System Administrator installs the program.
 
Cor, thank you for your answer.

I am programming an application for to create users in vbnet, and, the code
is:


Public Function crearUsuario(ByVal sLogin As String, ByVal sPassword As
String) As Boolean
Dim dirEntry As DirectoryEntry
Dim entries As DirectoryEntries
Dim newUser As DirectoryEntry

Try
crearUsuario = False
' Configurar Login y Nombre Completo
dirEntry = New DirectoryEntry("WinNT://" +
Environment.MachineName + ",computer")
entries = dirEntry.Children
newUser = entries.Add(sLogin, "user")

' Nombre completo
newUser.Properties("FullName").Add(sLogin)

' Descripción/Comentario
newUser.Properties("Description").Add(sLogin)

' El password expira o no expira (1 - true, 0 - false)
newUser.Properties("PasswordExpired").Add(0) ' no expira

' Password nunca expira
newUser.Properties("PasswordAge").Add(1)

' Set flags - User Cannot change password | Password never
expires.

newUser.Properties("Userflags").Add(ADSI_Flags.ADS_UF_PASSWD_CANT_CHANGEADS_UF_PASSWD_CANT_CHANGE
Or ADSI_Flags.ADS_UF_DONT_EXPIRE_PASSWDADS_UF_DONT_EXPIRE_PASSWD)


' Set the password.
Dim result As Object = newUser.Invoke("SetPassword", sPassword)
newUser.CommitChanges()
crearUsuario = True
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.Information, "Tareas CUBO TI")
End Try
End Function



this function create users of windows, but Now i need configure, in the same
function or other, the properties of "Enviroment", and "Profile of Terminal
Server Services", so, in the General Tab of User's porperties, i need
configure the options of "Terminal Service Profile" (options: Terminal
Services Home Folder/ Local path) and "Enviroment" (options: "Start the
following program when the user logs on", "Program file and path name",
"Start in" ). I need configure this options whith an application of vbnet,
please help me, if this is possible.
 
Back
Top