473,549 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5559
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.AllowLo go

WScript.Echo "Terminal Services Home Directory: " &
objUser.Termina lServicesHomeDi rector

WScript.Echo "Terminal Services Home Drive: " &
objUser.Termina lServicesHomeDr iv

WScript.Echo "Terminal Services Profile Path: " &
objUser.Termina lServicesProfil ePat

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

'************** *************** *************** *************** **********
'* Sessions ta
'************** *************** *************** *************** **********
WScript.Echo "Broken Connection Action: " & objUser.BrokenC onnectionActio
WScript.Echo "Max Connection Time: " & objUser.MaxConn ectionTim
WScript.Echo "Max Disconnection Time: " & objUser.MaxDisc onnectionTim
WScript.Echo "Max Idle Time: " & objUser.MaxIdle Tim
WScript.Echo "Reconnecti on Action: " & objUser.Reconne ctionActio

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

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

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

WScript.Echo "Terminal Services Initial Program: " &
objUser.Termina lServicesInitia lProgra

WScript.Echo "Terminal Services Work Directory: " &
objUser.Termina lServicesWorkDi rector
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.AllowLo gon

WScript.Echo "Terminal Services Home Directory: " & _
objUser.Termina lServicesHomeDi rectory

WScript.Echo "Terminal Services Home Drive: " & _
objUser.Termina lServicesHomeDr ive

WScript.Echo "Terminal Services Profile Path: " & _
objUser.Termina lServicesProfil ePath

'************* *************** *************** ************* **************'* Remote control tab
'************* *************** *************** ************* **************WScript.Echo "Enable Remote Control: " & objUser.EnableR emoteControl
'************* *************** *************** ************* **************'* Sessions tab
'************* *************** *************** ************* **************WScript.Echo "Broken Connection Action: " & objUser.BrokenC onnectionActionWScript.Echo "Max Connection Time: " & objUser.MaxConn ectionTimeWScript.Echo "Max Disconnection Time: " & objUser.MaxDisc onnectionTimeWScript.Echo "Max Idle Time: " & objUser.MaxIdle TimeWScript.Echo "Reconnecti on Action: " & objUser.Reconne ctionAction
'************* *************** *************** ************* **************'* Environment tab
'************* *************** *************** ************* **************WScript.Echo "Connect Client Drives At Logon: " & _
objUser.Connect ClientDrivesAtL ogon

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

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

WScript.Echo "Terminal Services Initial Program: " & _
objUser.Termina lServicesInitia lProgram

WScript.Echo "Terminal Services Work Directory: " & _
objUser.Termina lServicesWorkDi rectory
.

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)i nova.ch
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2291
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 sent to the 'console' session, no others). And the whole thing locks up when there is a server error. How can I see the server errors through...
5
7563
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 deployed to our terminal server for remote users to use. However, normal users (simple domain users) can not run the application. After double...
8
1784
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 hardcoded, I cannot make this same code happen. This is all I am trying to do: static void Stuff() { //we don't need the credentials on this form // so...
0
1207
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 hosted in Internet Explorer. I've been tasked with coming up with a strategy for our migration to using VB.Net. So far, I've experienced a number of...
8
2723
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 desktop ( On windows 2003 Server ), I need to determine in the code the machine name and username. If I use GetUsername and GetMachineName, it simply...
3
312
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 help is greatly appreciated! Josh
3
1737
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 2 different PC's? I have 30 users that need to log on to my SQL database.
3
2225
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 services. eDirectory uses the "userPassword" property to change the password and for a normal user, this has to be deleted and then added to in one...
8
3117
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 WScript.Echo vbCrLf & " Name: " & objMember.Name Next
0
7462
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7730
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6059
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3510
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1069
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
777
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.