By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,995 Members | 1,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,995 IT Pros & Developers. It's quick & easy.

ADSI + Terminal Services + .Net

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
>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.