Hi,
I want to determine the permissions set to a NT4 file share.
After hours spended on reading WMI documentation I get that result:
---------------------------------------------------
my $objsd;
my $wmi = Win32::OLE->GetObject("winmgmts:{impersonationLevel=impersonate}"
.
"!root/cimv2:Win32_LogicalShareSecuritySetting='temp'") or die
"Error!\n";
my $result = $wmi->GetSecurityDescriptor($objsd);
# my $result = $wmi->Invoke("GetSecurityDescriptor", $objsd);
my $type = Win32::OLE->QueryObjectType($objsd);
my $error = Win32::OLE->LastError();
---------------------------------------------------
The problem is, that $objsd won't changed in any way, altough both $result
and $error becomes 0. In my understanding that means, that the object-
method ended succesfully.
The corresponding VBscript looks like follow and works ok:
---------------------------------------------------
Set instance = GetObject("winmgmts:{impersonationLevel=impersonate}" & _
"!root/cimv2:Win32_LogicalShareSecuritySetting='temp'")
If instance Is Nothing Then
WScript.Echo("Unable to retrieve instance")
Else
retval = instance.GetSecurityDescriptor(objDescriptor)
dacl = objDescriptor.Properties_.Item("DACL").value
If retval = 0 And Err.Number = 0 Then
WScript.Echo("The security descriptor was obtained: " &
TypeName(objDescriptor))
endif
endif
---------------------------------------------------
Where I'm wrong? Any suggestions? 8-/
best regards, Johannes Studt
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs