The following example gets the security descriptor for an item.




Code Sample

# Set the item identifier of the item for which the security descriptor is to be returned.

$itemID = 1000;


# Read the security descriptor and enumerate the security entries.

$securityDescriptor = $xia.GET_SecurityDescriptor($itemID);

Write-Host "Inherited: " $securityDescriptor.Inherit;

foreach ($securityEntry in $securityDescriptor.SecurityEntries)

{

    Write-Host "Security Entry:";

    Write-Host $securityEntry.AccountName;

    Write-Host "Full Control: " $securityEntry.FullControl;

    Write-Host "Read: "$securityEntry.Read;

    Write-Host "Write: "$securityEntry.Write;