Hello,
Thank you for clarifying. You will need to create a Scheduled Task configured for User object type. The task will execute the below script for all users that have the ipPhone property specified. The script will either add the user to an existing group or create a new one and then add the user to is. The Scheduled Task needs to be executed just once and will look like the following:
As an alternative, you can create a similar Custom Command and execute it manually on the required users.
$groupName = "%ipPhone%"
$ouDN = "OU=ipgroups,OU=all,DC=company,DC=comc" #TODO: modify me
[Softerra.Adaxes.Interop.Adsi.ADS_GROUP_TYPE_ENUM]$groupType = "ADS_GROUP_TYPE_UNIVERSAL_GROUP, ADS_GROUP_TYPE_SECURITY_ENABLED" #TODO: modify me
# Bind to the container
$ou = $Context.BindToObjectEx("Adaxes://$ouDN", $True)
# Get group
try
{
$group = $Context.BindToObjectByDN("CN=$groupName,$ouDN")
}
catch
{
# Create group
$group = $ou.Create("group","CN=$groupName")
$group.Put("groupType", [Int32]$groupType)
$group.Put("sAMAccountName", $groupName)
$group.SetInfo()
}
# Add to group
$group.Add($Context.TargetObject.AdsPath)