Page 1 of 1 1
Topic Options
#86216 - 2002-06-21 06:20 PM Problem with initializing object...
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
code:
$wmifilesecsetting = GetObject ("winmgmts:Win32_LogicalFileSecuritySetting.path='i:\\owns.kix'")

$ok = $wmifilesecsetting.GetSecurityDescriptor($wmiSecDesc)

This GetSecurityDescriptor method doesn't work because the $wmisecDesc variable cannot be initialized to type Security_Descriptor via this method (in KiXtart).....

any thoughts?

Brian

[ 21 June 2002, 18:31: Message edited by: BrianTX ]

Top
#86217 - 2002-06-21 06:23 PM Re: Problem with initializing object...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
At first blush, don't think Kixtart needs the double slashes in the moniker there. That's usually a quirk of other languages ? Would only one slash fix it ?

[ 21 June 2002, 18:24: Message edited by: Shawn ]

Top
#86218 - 2002-06-21 06:30 PM Re: Problem with initializing object...
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
I tried it this way..no error .. with one slash it can't find the path.

Brian

Top
#86219 - 2002-06-21 07:23 PM Re: Problem with initializing object...
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
What if you set a variable for your path and 'added' it to your command...

code:
$path="i:\\owns.kix"
$wmifilesecsetting = GetObject ("winmgmts:Win32_LogicalFileSecuritySetting.path="+$path)


Top
#86220 - 2002-06-21 07:29 PM Re: Problem with initializing object...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Think this is one of these "pass by reference" thingies, even though the docs say it is passed by value, here how far i've got so far, unable to pull-out the security descriptor yet. But might be able to see whether that slashy is an issue or not.

break on

$sec = GetObject ("winmgmts:Win32_LogicalFileSecuritySetting.path='f:\t.kix'")

$flags = $sec.controlflags

exit

$SE_OWNER_DEFAULTED = 1
$SE_GROUP_DEFAULTED = 2
$SE_DACL_PRESENT = 4
$SE_DACL_DEFAULTED = 8
$SE_SACL_PRESENT = 16
$SE_SACL_DEFAULTED = 32
$SE_DACL_AUTO_INHERIT_REQ = 256
$SE_SACL_AUTO_INHERIT_REQ = 512
$SE_DACL_AUTO_INHERITED = 1024
$SE_SACL_AUTO_INHERITED = 2048
$SE_DACL_PROTECTED = 4096
$SE_SACL_PROTECTED = 8192
$SE_SELF_RELATIVE = 32768

Top
#86221 - 2002-06-21 07:31 PM Re: Problem with initializing object...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Pretty sure you can create a TEMPLATE security descriptor to pass to the function - but it doesn't work:

$sd = GetObject("winmgmts:Win32_SecurityDescriptor")

Top
#86222 - 2002-06-21 09:21 PM Re: Problem with initializing object...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
You would figure it would be something like this ?

break on

$sec = getobject ("winmgmts:win32_logicalfilesecuritysetting.path='f:\t.kix'")

$sd = getobject("winmgmts:win32_securitydescriptor")

$ok = $sec.GetSecurityDescriptor($sd)

@SERROR

exit 1


Top
#86223 - 2002-06-21 10:23 PM Re: Problem with initializing object...
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Sorry I hadn't been here.. I tried the "template" idea, as well, and it creates the object, but it doesn't return anything.

Brian

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 765 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.06 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

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