Hi
We made a single script for it
Import-Module ActiveDirectory
$property = "ou"
# Get property value
$value = $Context.GetModifiedPropertyValue($property)
if ([System.String]::IsNullOrEmpty($value))
{
return # The property wasn't changed
}
# Remove spaces
$value = $value.Replace(" ", "_")
$Context.LogMessage($value, "Information")
$names=@("AllUsers","Voice","Workspace","Exchange")
$location = "OU=Groups,%distinguishedName%"
$Context.LogMessage($location, "Information")
foreach($name in $names)
{
$name = $value+"_"+$name
$Context.LogMessage($name, "Information")
New-ADGroup -Name "$name" -SamAccountName "$name"-GroupCategory Security -groupScope Global -Path "$location" -Server:server.domain.local
}
If we run it in PowerShell directly (adaxes server, with properties set manually) it works fine. If we run it trough adaxes we get the error shown below. As we can see from the log part, the OU etc are being resolved correctly
Any idea why this happens?