473,388 Members | 1,330 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,388 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 5545
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.