Hello Joel,
Thank you for the provided details. You will need to save the request date into a property of the initiator account before running the script in your Business Rule. For example, you can use one of Adaxes custom date attributes (e.g. CustomAttributeDate1). In the script, you will need to get the date from the attribute and save it to the Notes property of the new group.
Then, you need to get the current date/time and also add it to the Notes property of the group. It will be different from the one saved to the custom attribute as the request can be approved any time. To add the approver (which is the manager of the requestor), use the %adm-InitiatorManagerFullName% value reference.
Below is a sample script:
# Get dates
$requestDate = $Context.TargetObject.Get("adm-CustomAttributeDate1")
$currentDate = Get-Date
# Form group notes
$notes = "Requested by %fullname% on $requestDate `r`n Approved by %adm-InitiatorManagerFullName% on $currentDate"
# Bind to the container
$containerDN = "OU=Groups,OU=DraculaTest,DC=aurora,DC=softerra,DC=llc"
$container = $Context.BindToObjectByDN($containerDN)
# Create group
[Softerra.Adaxes.Interop.Adsi.ADS_GROUP_TYPE_ENUM]$groupType =
"ADS_GROUP_TYPE_GLOBAL_GROUP, ADS_GROUP_TYPE_SECURITY_ENABLED"
$group = $container.Create("group","CN=New Group1")
$group.Put("groupType", [Int32]$groupType)
$group.Put("info",$notes)
$group.SetInfo()
The Business Rule will look like the following: