Update Security Descriptor
The following example modifies the security descriptor for an item.
- Connect to the configuration web service.
- Specify the unique identifier of the item for which the security descriptor is to be updated.
- The user must have at least modify security permissions to the item to execute this command.
Code Sample
# Set the item identifier of the item for which the security descriptor is to be updated.
$itemID = 37423;
# Set the account name to add to the security descriptor.
$accountName = "CENTREL-WS01\Managers";
# Read the existing descriptor.
$securityDescriptor = $xia.GET_SecurityDescriptor($itemID);
# Create a new security entry.
$securityEntry = New-Object "$($xia.GetType().Namespace).SecurityEntry";
$securityEntry.FullControl = $true;
$securityEntry.AccountName = $accountName;
# Ensure that the security descriptor does not inherit from the parent, and add the new security entry.
$securityDescriptor.Inherit = $false;
$securityDescriptor.SecurityEntries += $securityEntry;
# Update the security descriptor.
$xia.SET_SecurityDescriptor($itemId, $securityDescriptor, $true);