POV-Ray : Newsgroups : povray.off-topic : Frustration Server Time
13 Oct 2026 04:45:03 EDT (-0400)
  Frustration (Message 1 to 23 of 23)  
From: Invisible
Subject: Frustration
Date: 28 Apr 2010 09:25:28
Message: <4bd83748$1@news.povray.org>
OK, so I decided to try to use VBScript to actually do something *useful*.

Big mistake.

Anyway, apparently there's some sort of way to use LDAP to look up 
properties of a user's account in Active Directory. But there's a 
problem: you can't do anything until you discover the Distinguished Name 
of the account object.

I've wasted literally 2 hours trying to find this trivial piece of 
information. Given how vitally important it is, you'd think there would 
be a field *somewhere* in the properties dialog that would tell you what 
the ****ing DN is, but noooooo...

So I see that it's supposed to be possible to solve this using VBScript 
too. There are at least a dozen websites that all contain code nearly 
identical to this:

   set trans = CreateObject("NameTranslate")
   trans.Init 3, ""
   trans.Set 3, "domain\user"
   set name = trans.Get(1)
   WScript.Echo name

Only trouble is... it doesn't work. I've tried rephrasing the code every 
way I can think of, but still all I get is "error 800A01A8 on line 4". 
Absolutely nothing I do will make this god-damned error go away so that 
I can get to the actual data I want.

I give up.


Post a reply to this message

From: scott
Subject: Re: Frustration
Date: 28 Apr 2010 09:49:10
Message: <4bd83cd6@news.povray.org>
>   set trans = CreateObject("NameTranslate")
>   trans.Init 3, ""
>   trans.Set 3, "domain\user"
>   set name = trans.Get(1)
>   WScript.Echo name
>
> Only trouble is... it doesn't work. I've tried rephrasing the code every 
> way I can think of, but still all I get is "error 800A01A8 on line 4". 
> Absolutely nothing I do will make this god-damned error go away so that I 
> can get to the actual data I want.

Try removing the "set" at the beginning of line 4. IIRC set is only used to 
assign a reference of an object to your variable, not a value.


Post a reply to this message

From: Invisible
Subject: Re: Frustration
Date: 28 Apr 2010 09:49:14
Message: <4bd83cda$1@news.povray.org>
Invisible wrote:

>   set trans = CreateObject("NameTranslate")
>   trans.Init 3, ""
>   trans.Set 3, "domain\user"
>   set name = trans.Get(1)
>   WScript.Echo name
> 
> Only trouble is... it doesn't work.

Oh my god.

Apparently you have to delete the word "set" on line 4. And then it 
works perfectly. WTF?

2 hours to figure that out. Fantastic. >_<

It turns out that the DN is the user's real name, followed by the names 
of all the millions of OUs that the object is in, followed by the domain 
name. So my user account's DN is something like

   CN=Andrew, OU=Information Technology, OU=Departments, OU=Regular 
Users, OU=UK, OU=Sites, OU=Managed, DC=foo, DC=com

I much prefer referring to my user account by username. It's only 8 
characters. :-P

Still, at least fetching the email address worked without a hitch. And 
that was shortly followed by me obtaining the data I actually wanted: 
the date of the last password change. (WHY is this not in the GUI in the 
first place??)


Post a reply to this message

From: Invisible
Subject: Re: Frustration
Date: 28 Apr 2010 10:12:02
Message: <4bd84232@news.povray.org>
Invisible wrote:

> 2 hours to figure that out. Fantastic. >_<

I converted the script to JScript. This is much more familiar. 
Apparently the conversion isn't too difficult; you've got to replace 
"CreateObject" with "new ActiveXObject", and that's about it. The method 
syntax is also more regular.

I especially love the way that I get a different answer this way... (The 
date is formatted totally differently!)


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Frustration
Date: 28 Apr 2010 11:42:39
Message: <4bd8576f$1@news.povray.org>
Invisible wrote:
> Invisible wrote:
> 
>> 2 hours to figure that out. Fantastic. >_<
> 
> I converted the script to JScript. This is much more familiar.
> Apparently the conversion isn't too difficult; you've got to replace
> "CreateObject" with "new ActiveXObject", and that's about it. The method
> syntax is also more regular.
> 
> I especially love the way that I get a different answer this way... (The
> date is formatted totally differently!)

In case you didn't see it, I translated scott's VBScript example:

http://news.povray.org/4bd01976%241%40news.povray.org

into JScript:

http://news.povray.org/4bd20e90%40news.povray.org


Post a reply to this message

From: Darren New
Subject: Re: Frustration
Date: 28 Apr 2010 11:58:04
Message: <4bd85b0c$1@news.povray.org>
Invisible wrote:
> Apparently you have to delete the word "set" on line 4. And then it 
> works perfectly. WTF?

Yes. "Set" assigns objects. "Let" (or nothing) assigns non-objects. Welcome 
to OO BASIC. ;-)

> 2 hours to figure that out. Fantastic. >_<

That wasn't too bad.

>   CN=Andrew, OU=Information Technology, OU=Departments, OU=Regular 
> Users, OU=UK, OU=Sites, OU=Managed, DC=foo, DC=com

Welcome to X.500.  (OR is it X.400?)

> I much prefer referring to my user account by username. It's only 8 
> characters. :-P

And you can, until you want to know the *distinguished* name of the user. 
That's why they call it that. It's distinguished from all other users.

That list of names at the top will normally walk up the heirarchy of naming 
authorities, so it'll be you, at your department, at your company, as seen 
in Windows, in the UK, in the World.

> (WHY is this not in the GUI in the first place??)

Don't you start.


-- 
Darren New, San Diego CA, USA (PST)
   Linux: Now bringing the quality and usability of
   open source desktop apps to your personal electronics.


Post a reply to this message

From: nemesis
Subject: Re: Frustration
Date: 28 Apr 2010 12:13:43
Message: <4bd85eb7$1@news.povray.org>
Invisible escreveu:
> OK, so I decided to try to use X to actually do something *useful*.
> 
> Big mistake.

there, made a template for your posts.

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: nemesis
Subject: Re: Frustration
Date: 28 Apr 2010 12:15:01
Message: <4bd85f05$1@news.povray.org>
Invisible escreveu:
> Invisible wrote:
> 
>>   set trans = CreateObject("NameTranslate")
>>   trans.Init 3, ""
>>   trans.Set 3, "domain\user"
>>   set name = trans.Get(1)
>>   WScript.Echo name
>>
>> Only trouble is... it doesn't work.
> 
> Oh my god.
> 
> Apparently you have to delete the word "set" on line 4. And then it 
> works perfectly. WTF?
> 
> 2 hours to figure that out. Fantastic. >_<

yeah, nothing like good ol' RTFM instead of trial and error...

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Frustration
Date: 28 Apr 2010 13:08:24
Message: <4bd86b88@news.povray.org>
nemesis wrote:
> Invisible escreveu:
>> OK, so I decided to try to use X to actually do something *useful*.
>> 
>> Big mistake.
> 
> there, made a template for your posts.

I'm now tempted to feed Invisible's posts to a markov chain algorithm and 
see what comes out of it...


Post a reply to this message

From: Darren New
Subject: Re: Frustration
Date: 28 Apr 2010 13:39:29
Message: <4bd872d1$1@news.povray.org>
nemesis wrote:
> yeah, nothing like good ol' RTFM instead of trial and error...

To be fair, this is old tech, so MS doesn't exactly make it easy to find the 
documentation when you could be upgrading to VBNET.AWSOME.

-- 
Darren New, San Diego CA, USA (PST)
   Linux: Now bringing the quality and usability of
   open source desktop apps to your personal electronics.


Post a reply to this message

From: nemesis
Subject: Re: Frustration
Date: 28 Apr 2010 15:07:09
Message: <4bd8875d$1@news.povray.org>
Nicolas Alvarez escreveu:
> nemesis wrote:
>> Invisible escreveu:
>>> OK, so I decided to try to use X to actually do something *useful*.
>>>
>>> Big mistake.
>> there, made a template for your posts.
> 
> I'm now tempted to feed Invisible's posts to a markov chain algorithm and 
> see what comes out of it...

I'm sure he already did that in Haskell and we fools keep replying for 
his amusement.

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: Orchid XP v8
Subject: Re: Frustration
Date: 28 Apr 2010 15:12:03
Message: <4bd88883@news.povray.org>
>>>> OK, so I decided to try to use X to actually do something *useful*.
>>>>
>>>> Big mistake.
>>> there, made a template for your posts.
>>
>> I'm now tempted to feed Invisible's posts to a markov chain algorithm 
>> and see what comes out of it...
> 
> I'm sure he already did that in Haskell and we fools keep replying for 
> his amusement.

You know, I don't make a habit of telling everybody what an idiot *you* are.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: nemesis
Subject: Re: Frustration
Date: 28 Apr 2010 15:59:13
Message: <4bd89391$1@news.povray.org>
Orchid XP v8 escreveu:
>>>>> OK, so I decided to try to use X to actually do something *useful*.
>>>>>
>>>>> Big mistake.
>>>> there, made a template for your posts.
>>>
>>> I'm now tempted to feed Invisible's posts to a markov chain algorithm 
>>> and see what comes out of it...
>>
>> I'm sure he already did that in Haskell and we fools keep replying for 
>> his amusement.
> 
> You know, I don't make a habit of telling everybody what an idiot *you* 
> are.

good, I'll keep them from knowing how little sense of humor you have.

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: Dre
Subject: Re: Frustration
Date: 28 Apr 2010 18:59:42
Message: <4bd8bdde@news.povray.org>
"nemesis" <nam### [at] gmailcom> wrote in message 
news:4bd85eb7$1@news.povray.org...
> Invisible escreveu:
>> OK, so I decided to try to use X to actually do something *useful*.
>>
>> Big mistake.
>
> there, made a template for your posts.
>
> -- 
> a game sig: http://tinyurl.com/d3rxz9

LOL!

Cheers Dre


Post a reply to this message

From: Patrick Elliott
Subject: Re: Frustration
Date: 28 Apr 2010 23:34:17
Message: <4bd8fe39$1@news.povray.org>
On 4/28/2010 6:49 AM, Invisible wrote:
> Invisible wrote:
>
>> set trans = CreateObject("NameTranslate")
>> trans.Init 3, ""
>> trans.Set 3, "domain\user"
>> set name = trans.Get(1)
>> WScript.Echo name
>>
>> Only trouble is... it doesn't work.
>
> Oh my god.
>
> Apparently you have to delete the word "set" on line 4. And then it
> works perfectly. WTF?
>
As a rule, the word "set" is almost **never** used in VB, at all. I 
think there may be some obscure cases where you may use it, but, in 
general, its little more than a hold over from ages past, when it was 
mandatory. It hasn't been in most BASICs for... at least DOS1.0, maybe?

-- 
void main () {
   If Schrödingers_cat is alive or version > 98 {
     if version = "Vista" {
       call slow_by_half();
       call DRM_everything();
     }
     call functional_code();
   }
   else
     call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models, 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

From: scott
Subject: Re: Frustration
Date: 29 Apr 2010 02:33:15
Message: <4bd9282b$1@news.povray.org>
>> yeah, nothing like good ol' RTFM instead of trial and error...
>
> To be fair, this is old tech, so MS doesn't exactly make it easy to find 
> the documentation when you could be upgrading to VBNET.AWSOME.

I thought the expected upgrade from VBS/JavaScript was to powershell?

http://en.wikipedia.org/wiki/Windows_PowerShell


Post a reply to this message

From: scott
Subject: Re: Frustration
Date: 29 Apr 2010 02:35:30
Message: <4bd928b2$1@news.povray.org>
>> OK, so I decided to try to use X to actually do something *useful*.
>> 
>> Big mistake.
> 
> there, made a template for your posts.

You forgot the "obviously this is impossible" part :-)


Post a reply to this message

From: clipka
Subject: Re: Frustration
Date: 29 Apr 2010 04:05:44
Message: <4bd93dd8$1@news.povray.org>
Am 29.04.2010 05:34, schrieb Patrick Elliott:

> As a rule, the word "set" is almost **never** used in VB, at all. I
> think there may be some obscure cases where you may use it, but, in
> general, its little more than a hold over from ages past, when it was
> mandatory. It hasn't been in most BASICs for... at least DOS1.0, maybe?

That would be true for "let".

As for "set", it has been mandatory at least in every version of VBA 
that I ever touched. Not sure about full-fledged VB though.


Post a reply to this message

From: Phil Cook v2
Subject: Re: Frustration
Date: 29 Apr 2010 05:12:51
Message: <op.vbw2jscjmn4jds@phils>
And lo On Wed, 28 Apr 2010 15:49:14 +0200, Invisible <voi### [at] devnull> did  
spake thusly:

> Invisible wrote:
>
>>   set trans = CreateObject("NameTranslate")
>>   trans.Init 3, ""
>>   trans.Set 3, "domain\user"
>>   set name = trans.Get(1)
>>   WScript.Echo name
>>  Only trouble is... it doesn't work.
>
> Oh my god.
>
> Apparently you have to delete the word "set" on line 4. And then it  
> works perfectly. WTF?

and don't forget good practice in trans = nothing when you've finished  
with it ;-)

-- 
Phil Cook

--
I once tried to be apathetic, but I just couldn't be bothered
http://flipc.blogspot.com


Post a reply to this message

From: Aydan
Subject: Re: Frustration
Date: 29 Apr 2010 06:20:01
Message: <web.4bd95c2799a48b4d3771cd8e0@news.povray.org>
Patrick Elliott <sel### [at] npgcablecom> wrote:
> As a rule, the word "set" is almost **never** used in VB, at all. I
> think there may be some obscure cases where you may use it, but, in
> general, its little more than a hold over from ages past, when it was
> mandatory. It hasn't been in most BASICs for... at least DOS1.0, maybe?

The rule actually is if you do object assignment you use set if not then you
don't.


Post a reply to this message

From: Darren New
Subject: Re: Frustration
Date: 29 Apr 2010 12:37:07
Message: <4bd9b5b3$1@news.povray.org>
scott wrote:
>>> yeah, nothing like good ol' RTFM instead of trial and error...
>>
>> To be fair, this is old tech, so MS doesn't exactly make it easy to 
>> find the documentation when you could be upgrading to VBNET.AWSOME.
> 
> I thought the expected upgrade from VBS/JavaScript was to powershell?
> http://en.wikipedia.org/wiki/Windows_PowerShell

Depends if you want it in a shell or not.  VBS runs in web servers too.

-- 
Darren New, San Diego CA, USA (PST)
   Linux: Now bringing the quality and usability of
   open source desktop apps to your personal electronics.


Post a reply to this message

From: nemesis
Subject: Re: Frustration
Date: 29 Apr 2010 12:45:45
Message: <4bd9b7b9$1@news.povray.org>
scott escreveu:
>>> OK, so I decided to try to use X to actually do something *useful*.
>>>
>>> Big mistake.
>>
>> there, made a template for your posts.
> 
> You forgot the "obviously this is impossible" part :-)

Yeah, but I guess it's implied in "Big Mistake", plus it sounds better 
as a comic punchline. :)

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: Patrick Elliott
Subject: Re: Frustration
Date: 30 Apr 2010 21:34:12
Message: <4bdb8514$1@news.povray.org>
On 4/29/2010 1:05 AM, clipka wrote:
> Am 29.04.2010 05:34, schrieb Patrick Elliott:
>
>> As a rule, the word "set" is almost **never** used in VB, at all. I
>> think there may be some obscure cases where you may use it, but, in
>> general, its little more than a hold over from ages past, when it was
>> mandatory. It hasn't been in most BASICs for... at least DOS1.0, maybe?
>
> That would be true for "let".
>
> As for "set", it has been mandatory at least in every version of VBA
> that I ever touched. Not sure about full-fledged VB though.
Yeah, was thinking of "let".

-- 
void main () {
   If Schrödingers_cat is alive or version > 98 {
     if version = "Vista" {
       call slow_by_half();
       call DRM_everything();
     }
     call functional_code();
   }
   else
     call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models, 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.