Page 1 of 1 1
Topic Options
#205811 - 2012-09-26 12:46 AM New possibileity for SetOption
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
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


Edited by kholm (2012-09-26 01:08 AM)

Top
#205812 - 2012-09-26 02:57 AM Re: New possibileity for SetOption [Re: kholm]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4452
Loc: USA
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.

Top
#205813 - 2012-09-26 04:35 AM Re: New possibileity for SetOption [Re: Allen]
Shanee Offline
Fresh Scripter

Registered: 2006-10-13
Posts: 39
Loc: Tulsa, OK
Also...did you try the method that one of the responses on your link suggests?

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

Top
#205824 - 2012-09-26 11:53 PM Re: New possibileity for SetOption [Re: Shanee]
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
Shanee

I have tried the Get method, it works.

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

-Erik

Top
#205825 - 2012-09-27 12:35 AM Re: New possibileity for SetOption [Re: Allen]
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
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

Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 159 anonymous users online.
Newest Members
emnipetro, Hirze, thequeen, ameliaryan, shalomsalami
17641 Registered Users

Generated in 0.029 seconds in which 0.01 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org