IServiceObjectSecurity Method: GetObjectSecurity

GetObjectSecurity() As IObjectSecurity;

Return Value
IObjectSecurity interface that can be used to do other operations that cannot be performed using IServiceObjectSecurity. This interface instance has been initialized to the currently attached service.

Returns the IObjectSecurity pointer for the current service object. This is useful in performing advanced operations like getting the effective permissions, deleting an ACE and so on.


Dim ServiceSecurity As IServiceObjectSecurity
Dim ObjSec As IObjectSecurity
Dim AccessListObject As IAccessList
Set ServiceSecurity = CreateObject("DirectScript.ObjectSecurity")
'Attach to the messenger service on the computer "Moon".
ServiceSecurity.AttachService "messenger", "Moon"
'Get the IObjectSecurity interface
set ObjSec = ServiceSecurity.GetObjectSecurity
'Get the ACL for the service
Set AccessListObject = ObjSec.GetAccessList()


See Also