473,325 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 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 5542
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sara_S | last post by:
I am ready to move my ASP web site onto a remote host. The problem is that when I use Terminal Services to see the host machine, the error does not show up. (I was told that debugging info is only...
5
by: TPoise! | last post by:
Using: .NET 1.1, Visual Studio 2003, C#, Microsoft Windows 2000 Server (SP4 and all latest windows updates), Terminal Server running in application mode. I have a C# application that I've...
8
by: msnews.microsoft.com | last post by:
I have ADSI code that I can make work at the command line. I cannot in any way get it to work in asp.net. Even using Windows authentication, impersonation on, and providing the credentials...
0
by: Brian Young | last post by:
My department is responsible for creating custom internal applications for many of our departments. Our strategy has always been to develop our applications as ActiveX controls (VB6) that get...
8
by: OHM | last post by:
Hi peoples, I dont know where to place this question, so as I know you guys are all resourceful experts, I thought I would try here. I am writing some code which will be run usingh remote...
3
by: Josh Schmidt | last post by:
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...
3
by: shawn | last post by:
In the past I have had SQL and Terminal server on the same PC. With SQL and Windows 2003 Terminal server, you can not have them on the same PC. How can I make this work with SQL and Terminal and...
3
by: chat_devil | last post by:
hi, does anyone know if it is possible to remove an attribute that can not be read into the ADSI property cache/collection. i'm trying to do an eDirectory password change from .net directory...
8
by: John | last post by:
Hi, gurus, How can I implement the following feature in C#: Set objGroup = GetObject("WinNT://" & strComputer & "/" & strGroup & ", group") For Each objMember In objGroup.Members...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.