471,593 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,593 software developers and data experts.

ADSI + Terminal Services + .Net

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
Jul 21 '05 #1
3 5420
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
Jul 21 '05 #2
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
-----Original Message-----
This is a VBS example straight from the microsoft script center
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 tab
'************************************************ ******** **************WScript.Echo "Allow Logon: " & objUser.AllowLogon

WScript.Echo "Terminal Services Home Directory: " & _
objUser.TerminalServicesHomeDirectory

WScript.Echo "Terminal Services Home Drive: " & _
objUser.TerminalServicesHomeDrive

WScript.Echo "Terminal Services Profile Path: " & _
objUser.TerminalServicesProfilePath

'************************************************ ******** **************'* Remote control tab
'************************************************ ******** **************WScript.Echo "Enable Remote Control: " & objUser.EnableRemoteControl
'************************************************ ******** **************'* Sessions tab
'************************************************ ******** **************WScript.Echo "Broken Connection Action: " & objUser.BrokenConnectionActionWScript.Echo "Max Connection Time: " & objUser.MaxConnectionTimeWScript.Echo "Max Disconnection Time: " & objUser.MaxDisconnectionTimeWScript.Echo "Max Idle Time: " & objUser.MaxIdleTimeWScript.Echo "Reconnection Action: " & objUser.ReconnectionAction
'************************************************ ******** **************'* Environment tab
'************************************************ ******** **************WScript.Echo "Connect Client Drives At Logon: " & _
objUser.ConnectClientDrivesAtLogon

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

WScript.Echo "Default To Main Printer: " & _
objUser.DefaultToMainPrinter

WScript.Echo "Terminal Services Initial Program: " & _
objUser.TerminalServicesInitialProgram

WScript.Echo "Terminal Services Work Directory: " & _
objUser.TerminalServicesWorkDirectory
.

Jul 21 '05 #3
>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/de...figuration.asp

IADsTSUserEx Property Methods
http://msdn.microsoft.com/library/de...dstsuserex.asp

It's only included in Win2003 server.

Marc

================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Sara_S | last post: by
5 posts views Thread by TPoise! | last post: by
8 posts views Thread by msnews.microsoft.com | last post: by
3 posts views Thread by Josh Schmidt | last post: by
8 posts views Thread by John | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.