kholm
(Korg Regular)
2012-09-26 12:46 AM
New possibileity for SetOption

If you have to access an AD property where the name contains a dash, the solution in vbscript is to surround it with square brackets, but if you try this in KiXtart it will be mistaken for being an array.

Could we have ie.:

$PrevState = SetOption("IgnoereBrackets","On")

Or

$PrevState = SetOption("DisableArrays","On")

-Erik

An examle can be seen here: http://blogs.technet.com/b/heyscriptingg...n-its-name.aspx


AllenAdministrator
(KiX Supporter)
2012-09-26 02:57 AM
Re: New possibileity for SetOption

While not the solution you are looking for, there is a way to leverage vbscript right in kix...

Although I could not completely test this, it should get you in the right direction. You will need GetADUserProperties() to make this work:

 Code:
$User=getaduserproperties() 
$sc = CreateObject("ScriptControl")
$sc.language = "VBScript"
$sc.timeout = -1
$sc.addobject('vbuser',$user)
$sc.addcode('msds=vbuser.[msDS-User-Account-Control-Computed]')
$sc.run
? $sc.codeobject.msds


I would be willing to bet there is some other type of AD query that can get this info too.


Shanee
(Fresh Scripter)
2012-09-26 04:35 AM
Re: New possibileity for SetOption

Also...did you try the method that one of the responses on your link suggests?

objUser.Get("msDS-User-Account-Control-Computed")


kholm
(Korg Regular)
2012-09-26 11:53 PM
Re: New possibileity for SetOption

Shanee

I have tried the Get method, it works.

But if i try changing the value using the Put method, it fails

-Erik


kholm
(Korg Regular)
2012-09-27 12:35 AM
Re: New possibileity for SetOption

Allen

I had not seen your way of calling VBScript before

But I managed to solve the problem using the object: ScriptControl

Thank You

-Erik