ADSI + Terminal Services + .Net

J

Josh Schmidt

How can one set the terminal services profile and home
directory path in AD using VB.NET? I can set the usual
profile paths, but terminal services properties are not
supported with ADSI.

Any help is greatly appreciated!

Josh
 
G

Guest

This is a VBS example straight from the microsoft script cente

Set objUser = GetObject("LDAP://cn=youngrob,ou=r&d,dc=fabrikam,dc=com"

WScript.Echo objUser.Name & " Terminal Services Profile Settings
WScript.Echo "--------------------------------------------------

'*********************************************************************
'* Terminal Services Profile ta
'*********************************************************************
WScript.Echo "Allow Logon: " & objUser.AllowLogo

WScript.Echo "Terminal Services Home Directory: " &
objUser.TerminalServicesHomeDirector

WScript.Echo "Terminal Services Home Drive: " &
objUser.TerminalServicesHomeDriv

WScript.Echo "Terminal Services Profile Path: " &
objUser.TerminalServicesProfilePat

'*********************************************************************
'* Remote control ta
'*********************************************************************
WScript.Echo "Enable Remote Control: " & objUser.EnableRemoteContro

'*********************************************************************
'* Sessions ta
'*********************************************************************
WScript.Echo "Broken Connection Action: " & objUser.BrokenConnectionActio
WScript.Echo "Max Connection Time: " & objUser.MaxConnectionTim
WScript.Echo "Max Disconnection Time: " & objUser.MaxDisconnectionTim
WScript.Echo "Max Idle Time: " & objUser.MaxIdleTim
WScript.Echo "Reconnection Action: " & objUser.ReconnectionActio

'*********************************************************************
'* Environment ta
'*********************************************************************
WScript.Echo "Connect Client Drives At Logon: " &
objUser.ConnectClientDrivesAtLogo

WScript.Echo "Connect Client Printers At Logon: " &
objUser.ConnectClientPrintersAtLogo

WScript.Echo "Default To Main Printer: " &
objUser.DefaultToMainPrinte

WScript.Echo "Terminal Services Initial Program: " &
objUser.TerminalServicesInitialProgra

WScript.Echo "Terminal Services Work Directory: " &
objUser.TerminalServicesWorkDirector
 
G

Guest

I'm pretty sure you can only natively access the
properties like this when using win2k3. I'm working on
that for other reasons, but even if I convince the powers
that be it will be quite a while before it's in
production.

Thanks for the response though!

Any other thoughts?

Josh
 
M

Marc Scheuner [MVP ADSI]

How can one set the terminal services profile and home
directory path in AD using VB.NET? I can set the usual
profile paths, but terminal services properties are not
supported with ADSI.

Check out those links (watch for the wrapped URL's):

ADSI Extension for Terminal Services User Configuration
http://msdn.microsoft.com/library/d..._for_terminal_services_user_configuration.asp

IADsTSUserEx Property Methods
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/iadstsuserex.asp

It's only included in Win2003 server.

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top