Location: List Archives

List Archives

This forum is an archive of all posts to our mailing list over the past few years.  The forum is set read only therefore to contribute you will need to join our list community.  See more info about this here.

List Archives

Subject: [ActiveDir] Scripting Terminal
Prev Next
You are not authorized to post a reply.

AuthorMessages
davewadeUser is Offline

Posts:45

07/18/2008 9:30 AM  
Folks,

I am trying to script the terminal services fields in AD. I know these
are not real fields but it appears from the web that if I have the
"TsUserEx.Dlll" file I should be able to treat them like attributes. And
when it comes to reading the values I can. I can read fields like
"TerminalServicesHomeDirectory" and display them. What I don't seem to
be able to do is to set values into these fields.

I get the 8007200a error. Any thoughts on what I am doing wrong?

Dave Wade


**********************************************************************
This email, and any files transmitted with it, is confidential and
intended solely for the use of the individual or entity to whom they
are addressed. As a public body, the Council may be required to disclose this email, or any response to it, under the Freedom of Information Act 2000, unless the information in it is covered by one of the exemptions in the Act.

If you receive this email in error please notify Stockport ICT, Business Services via email.query@stockport.gov.uk and then permanently remove it from your system.

Thank you.

http://www.stockport.gov.uk
**********************************************************************


bsonposhUser is Offline

Posts:171

07/18/2008 9:30 AM  
Perhaps this will help.
http://dmitrysotnikov.wordpress.com/2008/02/13/managing-terminal-services-attributes-with-powershell/

On Thu, Jul 17, 2008 at 11:34 AM, Dave Wade <dave.wade@stockport.gov.uk>
wrote:

> Folks,
>
> I am trying to script the terminal services fields in AD. I know these are
> not real fields but it appears from the web that if I have the "TsUserEx.Dlll"
> file I should be able to treat them like attributes. And when it comes to
> reading the values I can. I can read fields like
> "TerminalServicesHomeDirectory" and display them. What I don't seem to be
> able to do is to set values into these fields.
>
> I get the 8007200a error. Any thoughts on what I am doing wrong?
> *Dave Wade*
> **
>
>
> **********************************************************************
> This email, and any files transmitted with it, is confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. As a public body, the Council may be required to disclose
> this email, or any response to it, under the Freedom of Information Act
> 2000, unless the information in it is covered by one of the exemptions in
> the Act.
>
> If you receive this email in error please notify Stockport ICT, Business
> Services via email.query@stockport.gov.uk and then permanently remove it
> from your system.
>
> Thank you.
>
> http://www.stockport.gov.uk
> **********************************************************************
>

listmailUser is Offline

Posts:463

07/18/2008 9:30 AM  
You can't treat the TS parameters as attributes, thinking/verbiage like that
may be what is causing you issue because they have to be handled in a very
specific way.

Have you seen the examples at

http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/user
sgroups/tsaccounts/


--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



_____

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 11:34 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] Scripting Terminal



Folks,

I am trying to script the terminal services fields in AD. I know these are
not real fields but it appears from the web that if I have the
"TsUserEx.Dlll" file I should be able to treat them like attributes. And
when it comes to reading the values I can. I can read fields like
"TerminalServicesHomeDirectory" and display them. What I don't seem to be
able to do is to set values into these fields.

I get the 8007200a error. Any thoughts on what I am doing wrong?

Dave Wade


**********************************************************************
This email, and any files transmitted with it, is confidential and
intended solely for the use of the individual or entity to whom they
are addressed. As a public body, the Council may be required to disclose
this email, or any response to it, under the Freedom of Information Act
2000, unless the information in it is covered by one of the exemptions in
the Act.

If you receive this email in error please notify Stockport ICT, Business
Services via email.query@stockport.gov.uk and then permanently remove it
from your system.

Thank you.

http://www.stockport.gov.uk
**********************************************************************


davewadeUser is Offline

Posts:45

07/18/2008 9:37 AM  
Thats what I thought, but thats what the scripts at :-

http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/
usersgroups/tsaccounts/

Seem to do, so what have I missed...

Dave Wade



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 18 July 2008 02:06
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Let's see it.


That error is

ERROR_DS_NO_ATTRIBUTE_OR_VALUE
winerror.h
# The specified directory service attribute or value does not

Which would seem to indicate that it is trying to use the fake
attribs like real attribs.


--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 2:02 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Joe,
As far as I can see my code is exactly the same as that at

"Configuring Terminal Services Profile Properties for a User
Account"

Dave Wade



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 17 July 2008 17:35
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


You can't treat the TS parameters as attributes,
thinking/verbiage like that may be what is causing you issue because
they have to be handled in a very specific way.

Have you seen the examples at


http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/
usersgroups/tsaccounts/


--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 11:34 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] Scripting Terminal



Folks,

I am trying to script the terminal services fields in
AD. I know these are not real fields but it appears from the web that if
I have the "TsUserEx.Dlll" file I should be able to treat them like
attributes. And when it comes to reading the values I can. I can read
fields like "TerminalServicesHomeDirectory" and display them. What I
don't seem to be able to do is to set values into these fields.

I get the 8007200a error. Any thoughts on what I am
doing wrong?

Dave Wade




**********************************************************************
This email, and any files transmitted with it, is
confidential and
intended solely for the use of the individual or entity
to whom they
are addressed. As a public body, the Council may be
required to disclose this email, or any response to it, under the
Freedom of Information Act 2000, unless the information in it is covered
by one of the exemptions in the Act.

If you receive this email in error please notify
Stockport ICT, Business Services via email.query@stockport.gov.uk and
then permanently remove it from your system.

Thank you.

http://www.stockport.gov.uk

**********************************************************************



royheleiyingUser is Offline

Posts:1

07/18/2008 9:37 AM  
All,

I am new to this list and I am wondering if any one has experience introducing window server 2008 into a Windows 2000 native domain/forest AD environment, Any implications?

Thanks,
Ying


From: Dave Wade
Sent: Friday, July 18, 2008 4:19 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Thats what I thought, but thats what the scripts at :-

http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/tsaccounts/

Seem to do, so what have I missed...

Dave Wade




------------------------------------------------------------------------------
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 18 July 2008 02:06
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Let's see it.


That error is

ERROR_DS_NO_ATTRIBUTE_OR_VALUE winerror.h
# The specified directory service attribute or value does not

Which would seem to indicate that it is trying to use the fake attribs like real attribs.


--
O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm
s




------------------------------------------------------------------------------
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 2:02 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Joe,
As far as I can see my code is exactly the same as that at

"Configuring Terminal Services Profile Properties for a User Account"

Dave Wade




----------------------------------------------------------------------------
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 17 July 2008 17:35
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


You can't treat the TS parameters as attributes, thinking/verbiage like that may be what is causing you issue because they have to be handled in a very specific way.

Have you seen the examples at

http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/tsaccounts/


--
O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm





----------------------------------------------------------------------------
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 11:34 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] Scripting Terminal


Folks,

I am trying to script the terminal services fields in AD. I know these are not real fields but it appears from the web that if I have the "TsUserEx.Dlll" file I should be able to treat them like attributes. And when it comes to reading the values I can. I can read fields like "TerminalServicesHomeDirectory" and display them. What I don't seem to be able to do is to set values into these fields.

I get the 8007200a error. Any thoughts on what I am doing wrong?

Dave Wade


**********************************************************************
This email, and any files transmitted with it, is confidential and
intended solely for the use of the individual or entity to whom they
are addressed. As a public body, the Council may be required to disclose this email, or any response to it, under the Freedom of Information Act 2000, unless the information in it is covered by one of the exemptions in the Act.

If you receive this email in error please notify Stockport ICT, Business Services via email.query@stockport.gov.uk and then permanently remove it from your system.

Thank you.

http://www.stockport.gov.uk
**********************************************************************

davewadeUser is Offline

Posts:45

07/18/2008 11:20 AM  
Not sure if I have passed enough but basically I am saving the values:-

strUserInfo = "Profile<" & objuserobj.get("ProfilePath") & ">" & VBcrlf
strUserInfo = strUserInfo & "Script<" & objuserobj.get("ScriptPath") &
">" & vbcrlf
strUserInfo = strUserInfo & "HomeDir<" & objuserobj.get("HomeDirectory")
& ">" & vbcrlf
strUserInfo = strUserInfo & "TSProfile<" &
objuserobj.TerminalServicesProfilePath & ">" & vbcrlf
strUserInfo = strUserInfo & "TSHome<" &
objuserobj.TerminalServicesHomeDirectory & ">" & vbcrlf

which works fine. Its then when I start to try and clear the fields I
get an error.

The code at present is

objuserobj.putex 1 , "ProfilePath" , ""
objuserobj.putex 1 , "ScriptPath" , ""
objuserobj.putex 1 , "HomeDirectory" , ""

objuserobj.setinfo

Which works , but if I try the same with a TS field it fails. I tried
both constructs as bellow..

objuserobj.putex 1 , "TerminalServicesHomeDirectory" , ""
objUserobj.TerminalServicesHomeDrive = ""

with no luck. Should I use a different userobject for normal and ts....

Dave Wade
Business Services I.C.T.
0161 474 5456



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 18 July 2008 14:43
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Can we see the script Dave?



--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Friday, July 18, 2008 4:19 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Thats what I thought, but thats what the scripts at :-


http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/
usersgroups/tsaccounts/

Seem to do, so what have I missed...

Dave Wade



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 18 July 2008 02:06
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Let's see it.


That error is

ERROR_DS_NO_ATTRIBUTE_OR_VALUE
winerror.h
# The specified directory service attribute or value
does not

Which would seem to indicate that it is trying to use
the fake attribs like real attribs.


--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 2:02 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Joe,
As far as I can see my code is exactly the same as that
at

"Configuring Terminal Services Profile Properties for a
User Account"

Dave Wade



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 17 July 2008 17:35
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


You can't treat the TS parameters as attributes,
thinking/verbiage like that may be what is causing you issue because
they have to be handled in a very specific way.

Have you seen the examples at


http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/
usersgroups/tsaccounts/


--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 11:34 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] Scripting Terminal



Folks,

I am trying to script the terminal services
fields in AD. I know these are not real fields but it appears from the
web that if I have the "TsUserEx.Dlll" file I should be able to treat
them like attributes. And when it comes to reading the values I can. I
can read fields like "TerminalServicesHomeDirectory" and display them.
What I don't seem to be able to do is to set values into these fields.

I get the 8007200a error. Any thoughts on what I
am doing wrong?

Dave Wade




**********************************************************************
This email, and any files transmitted with it,
is confidential and
intended solely for the use of the individual or
entity to whom they
are addressed. As a public body, the Council may
be required to disclose this email, or any response to it, under the
Freedom of Information Act 2000, unless the information in it is covered
by one of the exemptions in the Act.

If you receive this email in error please notify
Stockport ICT, Business Services via email.query@stockport.gov.uk and
then permanently remove it from your system.

Thank you.

http://www.stockport.gov.uk

**********************************************************************



joeUser is Offline

Posts:78

07/18/2008 10:48 PM  
Like people have been saying, it isn't an actual AD attribute. It is only a
property on IADsTsUserEx. Thus, you can't access it with Get, GetEx, Put or
PutEx as those operate on actual attributes.

Try setting it to a null string or nothing to see if that clears it.

BTW, this particular interface/design choice by the TS team is supremely
annoying to me. Not only does it cause this type of confusion, but it is
also undocumented and basically impossible to deal with if you aren't using
ADSI. Boo!

Joe K.

----- Original Message -----
From: "Dave Wade" <dave.wade@stockport.gov.uk>
To: <ActiveDir@mail.activedir.org>
Sent: Friday, July 18, 2008 10:15 AM
Subject: RE: [ActiveDir] Scripting Terminal


Not sure if I have passed enough but basically I am saving the values:-

strUserInfo = "Profile<" & objuserobj.get("ProfilePath") & ">" & VBcrlf
strUserInfo = strUserInfo & "Script<" & objuserobj.get("ScriptPath") &
">" & vbcrlf
strUserInfo = strUserInfo & "HomeDir<" & objuserobj.get("HomeDirectory")
& ">" & vbcrlf
strUserInfo = strUserInfo & "TSProfile<" &
objuserobj.TerminalServicesProfilePath & ">" & vbcrlf
strUserInfo = strUserInfo & "TSHome<" &
objuserobj.TerminalServicesHomeDirectory & ">" & vbcrlf

which works fine. Its then when I start to try and clear the fields I
get an error.

The code at present is

objuserobj.putex 1 , "ProfilePath" , ""
objuserobj.putex 1 , "ScriptPath" , ""
objuserobj.putex 1 , "HomeDirectory" , ""

objuserobj.setinfo

Which works , but if I try the same with a TS field it fails. I tried
both constructs as bellow..

objuserobj.putex 1 , "TerminalServicesHomeDirectory" , ""
objUserobj.TerminalServicesHomeDrive = ""

with no luck. Should I use a different userobject for normal and ts....

Dave Wade
Business Services I.C.T.
0161 474 5456



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 18 July 2008 14:43
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Can we see the script Dave?



--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Friday, July 18, 2008 4:19 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Thats what I thought, but thats what the scripts at :-


http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/
usersgroups/tsaccounts/

Seem to do, so what have I missed...

Dave Wade



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 18 July 2008 02:06
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Let's see it.


That error is

ERROR_DS_NO_ATTRIBUTE_OR_VALUE
winerror.h
# The specified directory service attribute or value
does not

Which would seem to indicate that it is trying to use
the fake attribs like real attribs.


--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 2:02 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Joe,
As far as I can see my code is exactly the same as that
at

"Configuring Terminal Services Profile Properties for a
User Account"

Dave Wade



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 17 July 2008 17:35
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


You can't treat the TS parameters as attributes,
thinking/verbiage like that may be what is causing you issue because
they have to be handled in a very specific way.

Have you seen the examples at


http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/
usersgroups/tsaccounts/


--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 11:34 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] Scripting Terminal



Folks,

I am trying to script the terminal services
fields in AD. I know these are not real fields but it appears from the
web that if I have the "TsUserEx.Dlll" file I should be able to treat
them like attributes. And when it comes to reading the values I can. I
can read fields like "TerminalServicesHomeDirectory" and display them.
What I don't seem to be able to do is to set values into these fields.

I get the 8007200a error. Any thoughts on what I
am doing wrong?

Dave Wade




**********************************************************************
This email, and any files transmitted with it,
is confidential and
intended solely for the use of the individual or
entity to whom they
are addressed. As a public body, the Council may
be required to disclose this email, or any response to it, under the
Freedom of Information Act 2000, unless the information in it is covered
by one of the exemptions in the Act.

If you receive this email in error please notify
Stockport ICT, Business Services via email.query@stockport.gov.uk and
then permanently remove it from your system.

Thank you.

http://www.stockport.gov.uk

**********************************************************************



List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ma/default.aspx
michael1User is Offline

Posts:184

07/19/2008 9:23 AM  
Blame it on Citrix.

Or on WinNT with its fixed directory.

That blob has been around that long...

Regards,

Michael B. Smith
MCITP:SA,EMA/MCSE/Exchange MVP
http://TheEssentialExchange.com


-----Original Message-----
From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Joe Kaplan
Sent: Friday, July 18, 2008 10:45 PM
To: ActiveDir@mail.activedir.org
Subject: Re: [ActiveDir] Scripting Terminal

Like people have been saying, it isn't an actual AD attribute. It is only a

property on IADsTsUserEx. Thus, you can't access it with Get, GetEx, Put or

PutEx as those operate on actual attributes.

Try setting it to a null string or nothing to see if that clears it.

BTW, this particular interface/design choice by the TS team is supremely
annoying to me. Not only does it cause this type of confusion, but it is
also undocumented and basically impossible to deal with if you aren't using
ADSI. Boo!

Joe K.

----- Original Message -----
From: "Dave Wade" <dave.wade@stockport.gov.uk>
To: <ActiveDir@mail.activedir.org>
Sent: Friday, July 18, 2008 10:15 AM
Subject: RE: [ActiveDir] Scripting Terminal


Not sure if I have passed enough but basically I am saving the values:-

strUserInfo = "Profile<" & objuserobj.get("ProfilePath") & ">" & VBcrlf
strUserInfo = strUserInfo & "Script<" & objuserobj.get("ScriptPath") &
">" & vbcrlf
strUserInfo = strUserInfo & "HomeDir<" & objuserobj.get("HomeDirectory")
& ">" & vbcrlf
strUserInfo = strUserInfo & "TSProfile<" &
objuserobj.TerminalServicesProfilePath & ">" & vbcrlf
strUserInfo = strUserInfo & "TSHome<" &
objuserobj.TerminalServicesHomeDirectory & ">" & vbcrlf

which works fine. Its then when I start to try and clear the fields I
get an error.

The code at present is

objuserobj.putex 1 , "ProfilePath" , ""
objuserobj.putex 1 , "ScriptPath" , ""
objuserobj.putex 1 , "HomeDirectory" , ""

objuserobj.setinfo

Which works , but if I try the same with a TS field it fails. I tried
both constructs as bellow..

objuserobj.putex 1 , "TerminalServicesHomeDirectory" , ""
objUserobj.TerminalServicesHomeDrive = ""

with no luck. Should I use a different userobject for normal and ts....

Dave Wade
Business Services I.C.T.
0161 474 5456



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 18 July 2008 14:43
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Can we see the script Dave?



--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Friday, July 18, 2008 4:19 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Thats what I thought, but thats what the scripts at :-


http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/
usersgroups/tsaccounts/

Seem to do, so what have I missed...

Dave Wade



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 18 July 2008 02:06
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Let's see it.


That error is

ERROR_DS_NO_ATTRIBUTE_OR_VALUE
winerror.h
# The specified directory service attribute or value
does not

Which would seem to indicate that it is trying to use
the fake attribs like real attribs.


--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 2:02 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


Joe,
As far as I can see my code is exactly the same as that
at

"Configuring Terminal Services Profile Properties for a
User Account"

Dave Wade



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 17 July 2008 17:35
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal


You can't treat the TS parameters as attributes,
thinking/verbiage like that may be what is causing you issue because
they have to be handled in a very specific way.

Have you seen the examples at


http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/
usersgroups/tsaccounts/


--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm



________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 11:34 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] Scripting Terminal



Folks,

I am trying to script the terminal services
fields in AD. I know these are not real fields but it appears from the
web that if I have the "TsUserEx.Dlll" file I should be able to treat
them like attributes. And when it comes to reading the values I can. I
can read fields like "TerminalServicesHomeDirectory" and display them.
What I don't seem to be able to do is to set values into these fields.

I get the 8007200a error. Any thoughts on what I
am doing wrong?

Dave Wade




**********************************************************************
This email, and any files transmitted with it,
is confidential and
intended solely for the use of the individual or
entity to whom they
are addressed. As a public body, the Council may
be required to disclose this email, or any response to it, under the
Freedom of Information Act 2000, unless the information in it is covered
by one of the exemptions in the Act.

If you receive this email in error please notify
Stockport ICT, Business Services via email.query@stockport.gov.uk and
then permanently remove it from your system.

Thank you.

http://www.stockport.gov.uk

**********************************************************************



List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ma/default.aspx

List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ma/default.aspx
guyt76User is Offline

Posts:11

07/19/2008 10:22 AM  
Dave,



I have just checked your snippet and it does work. The only issue I see
with it is when profilePath, scriptPath or homeDirectory are not set for
a user account - the script will bomb out with -2147463155 ("The
directory property cannot be found in the cache").



Try the following:



On Error Resume Next



strAttrInfo = "Profile<" & objuserobj.get("ProfilePath") & ">" & VBcrlf

if Err.Number = 0 Then strUserInfo = strAttrInfo

Err.Clear



strAttrInfo = "Script<" & objuserobj.get("ScriptPath") & ">"

if Err.Number = 0 Then strUserInfo = strUserInfo & strAttrInfo & vbcrlf

Err.Clear



strAttrInfo = "HomeDir<" & objuserobj.get("HomeDirectory") & ">"

if Err.Number = 0 Then strUserInfo = strUserInfo & strAttrInfo & vbcrlf

Err.Clear



strUserInfo = strUserInfo & "TSProfile<" &
objuserobj.TerminalServicesProfilePath & ">" & vbcrlf

strUserInfo = strUserInfo & "TSHome<" &
objuserobj.TerminalServicesHomeDirectory & ">" & vbcrlf



wscript.echo strUserInfo



Guy



From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Friday, July 18, 2008 18:15
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal



Not sure if I have passed enough but basically I am saving the values:-



strUserInfo = "Profile<" & objuserobj.get("ProfilePath") & ">" & VBcrlf
strUserInfo = strUserInfo & "Script<" & objuserobj.get("ScriptPath") &
">" & vbcrlf
strUserInfo = strUserInfo & "HomeDir<" & objuserobj.get("HomeDirectory")
& ">" & vbcrlf
strUserInfo = strUserInfo & "TSProfile<" &
objuserobj.TerminalServicesProfilePath & ">" & vbcrlf
strUserInfo = strUserInfo & "TSHome<" &
objuserobj.TerminalServicesHomeDirectory & ">" & vbcrlf



which works fine. Its then when I start to try and clear the fields I
get an error.



The code at present is



objuserobj.putex 1 , "ProfilePath" , ""
objuserobj.putex 1 , "ScriptPath" , ""
objuserobj.putex 1 , "HomeDirectory" , ""



objuserobj.setinfo



Which works , but if I try the same with a TS field it fails. I tried
both constructs as bellow..



objuserobj.putex 1 , "TerminalServicesHomeDirectory" , ""

objUserobj.TerminalServicesHomeDrive = ""



with no luck. Should I use a different userobject for normal and ts....



Dave Wade

Business Services I.C.T.

0161 474 5456





________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 18 July 2008 14:43
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal

Can we see the script Dave?







--

O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm







________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Friday, July 18, 2008 4:19 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal

Thats what I thought, but thats what the scripts at :-




http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/
usersgroups/tsaccounts/



Seem to do, so what have I missed...



Dave Wade





________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 18 July 2008 02:06
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal

Let's see it.





That error is



ERROR_DS_NO_ATTRIBUTE_OR_VALUE
winerror.h
# The specified directory service attribute or value
does not



Which would seem to indicate that it is trying to use
the fake attribs like real attribs.





--

O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm







________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 2:02 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal

Joe,

As far as I can see my code is exactly the same as that
at



"Configuring Terminal Services Profile Properties for a
User Account"



Dave Wade





________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of joe
Sent: 17 July 2008 17:35
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Scripting Terminal

You can't treat the TS parameters as attributes,
thinking/verbiage like that may be what is causing you issue because
they have to be handled in a very specific way.



Have you seen the examples at




http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/
usersgroups/tsaccounts/





--

O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm







________________________________

From: ActiveDir-owner@mail.activedir.org
[mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Dave Wade
Sent: Thursday, July 17, 2008 11:34 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] Scripting Terminal

Folks,

I am trying to script the terminal services
fields in AD. I know these are not real fields but it appears from the
web that if I have the "TsUserEx.Dlll" file I should be able to treat
them like attributes. And when it comes to reading the values I can. I
can read fields like "TerminalServicesHomeDirectory" and display them.
What I don't seem to be able to do is to set values into these fields.

I get the 8007200a error. Any thoughts on what I
am doing wrong?

Dave Wade




**********************************************************************
This email, and any files transmitted with it,
is confidential and
intended solely for the use of the individual or
entity to whom they
are addressed. As a public body, the Council may
be required to disclose this email, or any response to it, under the
Freedom of Information Act 2000, unless the information in it is covered
by one of the exemptions in the Act.

If you receive this email in error please notify
Stockport ICT, Business Services via email.query@stockport.gov.uk and
then permanently remove it from your system.

Thank you.

http://www.stockport.gov.uk

**********************************************************************


You are not authorized to post a reply.
Forums >ActiveDir Mail List Archive >List Archives > [ActiveDir] Scripting Terminal



ActiveForums 3.7
AdventNet Banner
Friends

Friends

Namescape
Members

Members

MembershipMembership:
Latest New UserLatest:cthart
New TodayNew Today:1
New YesterdayNew Yesterday:5
User CountOverall:4285

People OnlinePeople Online:
VisitorsVisitors:75
MembersMembers:0
TotalTotal:75

Online NowOnline Now:

Ads

Copyright 2008 ActiveDir.org
Terms Of Use