Click here to Skip to main content
15,908,020 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: DateFormat Pin
John Petersen30-Aug-06 0:40
John Petersen30-Aug-06 0:40 
AnswerRe: DateFormat Pin
Mike Dimmick30-Aug-06 1:46
Mike Dimmick30-Aug-06 1:46 
AnswerRe: DateFormat Pin
Guffa30-Aug-06 19:40
Guffa30-Aug-06 19:40 
QuestionComboBox.Items.Insert(int index, object obj) - > whats the object? Pin
saud_a_k29-Aug-06 19:24
saud_a_k29-Aug-06 19:24 
AnswerRe: ComboBox.Items.Insert(int index, object obj) - > whats the object? Pin
Nagaraju_Focus29-Aug-06 21:16
Nagaraju_Focus29-Aug-06 21:16 
QuestionRe: ComboBox.Items.Insert(int index, object obj) - > whats the object? Pin
saud_a_k29-Aug-06 21:21
saud_a_k29-Aug-06 21:21 
QuestionResource file Error Pin
Rabbit1729-Aug-06 15:42
Rabbit1729-Aug-06 15:42 
QuestionWorking with TSUSEREXLib.IADsTSUserEx in .NET, need help please Pin
Jaymz66629-Aug-06 0:45
Jaymz66629-Aug-06 0:45 
Hello everyone.

I'm currently developing a winforms application in C# which adds
multiple users to an OranizationalUnit with one mouse click. Also the
homedirectory is set using the System.directoryservices namespace.
Everything works fine.


Now i need to enter the Terminal Server User Profile Path and Local
Path. I've been surfing around the web for a while and found one
article from a user named SG.


This is what I made of it:


private TSUSEREXLib.IADsTSUserEx m_TsUser; <br />
private DirectoryEntry m_DirectoryEntry; <br />
<br />
<br />
ActiveDs.IADsUser iADsUser = (ActiveDs.IADsUser) m_DirectoryEntry.NativeADObject; <br />
m_TsUser = (TSUSEREXLib.IADsTSUserEx) iADsUser; 



On the last line, it throws an exeption: "specified cast is not valid".


The DirectoryEntry, m_DirectoryEntry, is created this way:

objUser = objOU.Children.Add(strUser, "user"); <br />
objUser.Properties["displayName"].Add(strDisplayName); <br />
objUser.Properties["userPrincipalName"].Add(strUserPrincipalName); <br />
objUser.Properties["givenName"].Add(FirstName); <br />
objUser.Properties["sn"].Add(Lastname); <br />
objUser.Properties["sAMAccountName"].Add(Username); <br />
objUser.Properties["homeDirectory"].Add(@"c:\test"); <br />
objUser.Properties["homeDrive"].Add(@"y:"); <br />
<br />
objUser.CommitChanges(); 



objUser is then used to bind to TSUSEREXLib.IADsTSUserEx. Can some one
explain to me why I get the exception thrown? Or even better, does
someone have a better example of how to use IADsTSUserEx in C#/VB.net?


Many thanks
Questionvisual studio .net Pin
nkjha128-Aug-06 22:25
nkjha128-Aug-06 22:25 
AnswerRe: visual studio .net Pin
coolestCoder29-Aug-06 2:05
coolestCoder29-Aug-06 2:05 
GeneralRe: visual studio .net Pin
nkjha130-Aug-06 22:54
nkjha130-Aug-06 22:54 
GeneralRe: visual studio .net Pin
coolestCoder30-Aug-06 23:03
coolestCoder30-Aug-06 23:03 
QuestionWhich Platforms supported by Dot Net ? Pin
subburaj.sabapathy28-Aug-06 21:28
subburaj.sabapathy28-Aug-06 21:28 
AnswerRe: Which Platforms supported by Dot Net ? Pin
Guffa28-Aug-06 21:59
Guffa28-Aug-06 21:59 
AnswerRe: Which Platforms supported by Dot Net ? Pin
Dave Kreskowiak29-Aug-06 2:13
mveDave Kreskowiak29-Aug-06 2:13 
QuestionProperty Grid : Assigning element of array object to SelectedObject Property Pin
mukhpreet@yahoo.com28-Aug-06 8:14
mukhpreet@yahoo.com28-Aug-06 8:14 
QuestionGet text from _WwG class Pin
priyank_ldce28-Aug-06 5:26
priyank_ldce28-Aug-06 5:26 
QuestionHow to determine .net framework version in installer Pin
code4jigar28-Aug-06 0:14
code4jigar28-Aug-06 0:14 
QuestionWriting to appsettings with file attribute writes to wrong file? [modified] Pin
John De Angelis27-Aug-06 23:16
John De Angelis27-Aug-06 23:16 
GeneralRe: Writing to appsettings with file attribute writes to wrong file? Pin
Guffa28-Aug-06 6:19
Guffa28-Aug-06 6:19 
GeneralRe: Writing to appsettings with file attribute writes to wrong file? Pin
John De Angelis28-Aug-06 11:07
John De Angelis28-Aug-06 11:07 
Questionhow can i view HTML content in .NET Compact Framework Pin
Your Code26-Aug-06 22:04
Your Code26-Aug-06 22:04 
QuestionAltering a special directory dynamic property - VS2003 Pin
moitani25-Aug-06 0:57
moitani25-Aug-06 0:57 
Question64 bit application Pin
psamy25-Aug-06 0:07
psamy25-Aug-06 0:07 
AnswerRe: 64 bit application Pin
Dave Kreskowiak25-Aug-06 5:48
mveDave Kreskowiak25-Aug-06 5:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.