Knowledgebase
How to get information in Cinegy Convert about the user who performed the content import?
Posted by Oleh Muliarchuk on 13 March 2023 08:40

If only information about the import operator is needed, you can get some info from the metadata. We recommend using a small pre-script that extracts the name of a file owner from AD and enters it into a custom metadata field.


# IMPORT PRE
param($provider)

$fileName = $provider.Metadata['src.name']
$fileLocation = $provider.Metadata['src.location']
$filePath = [io.path]::combine($fileLocation, $fileName)

$user = Get-Acl $filePath | Select -ExpandProperty Owner
$userName = $user.Split('\')[1]

$provider.AddMetadata('src.meta.created_by', $user.Split('\')[1]);

(0 vote(s))
Helpful
Not helpful

Comments (0)