Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Ad and TerminalServicesProfilePath

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-09-2007   #1 (permalink)
Petter Huseby
Guest


 

Ad and TerminalServicesProfilePath

Hi

I have problemes with reading a AD property on a user: This is my script:

$objUser = [ADSI]"LDAP://cca1dc0003:389/cn=petter,OU=Terminal
Server,OU=Server Accounts Test,dc=cca1,dc=root4,dc=pri"
$objUser.get("TerminalServicesProfilePath")

If I run this I get a error saying: the directory property cannot be found
in the local chache.

But When I create this VB script everything is working perfect:

Set objUser = GetObject("LDAP://cca1dc0003:389/cn=petter,OU=Terminal
Server,OU=Server Accounts Test,dc=cca1,dc=root4,dc=pri")
WScript.Echo "User Principal Name: " & objUser.TerminalServicesProfilePath

Can someone see a error in my powerscript file?



My System SpecsSystem Spec
Old 01-11-2007   #2 (permalink)
Reinhard Lehrbaum
Guest


 

Re: Ad and TerminalServicesProfilePath

On Tue, 9 Jan 2007 01:29:00 -0800, Petter Huseby <Petter
Huseby@discussions.microsoft.com> wrote:

>Hi
>
>I have problemes with reading a AD property on a user: This is my script:
>
>$objUser = [ADSI]"LDAP://cca1dc0003:389/cn=petter,OU=Terminal
>Server,OU=Server Accounts Test,dc=cca1,dc=root4,dc=pri"
>$objUser.get("TerminalServicesProfilePath")


The property TerminalServicesProfilePath does not exist within the
DirectoryEntry.Properties.

Try this:
$objUser.psbase.InvokeGet("terminalservicesprofilepath")


Reinhard
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes




Update your Vista Drivers Update Your Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008