Hello,
I have this script in a workflow where the trigger is changed attribute extensionattribute1 OR physicaldeliveryoffice. Thing is that When one of these attributes change, the worklow is launche but the script only can get the changed attributte.
In the same way, When one of these attributes is change I cannot get any oher attributes like DN or samaccountname.
How can i get any other attribute in addition to the change attribute that launch the workflow.
function GetValue
{
param
(
$Request,
$Attribute
)
try
{
$Value = $Request.Get($Attribute)
if(-not $value)
{
$Value = $DirObj.Get($Attribute)
}
}
catch
{
$value = $null
}
return $value
}
function CalculOUdestination($Request){
$oupath = ",OU=Colisee,OU=Usuarios,DC=local,DC=colisee,DC=es"
$OU = ""
$code_eta = GetValue $Request "physicalDeliveryOfficeName"
$code_eta2 = $Request.get("physicalDeliveryOfficeName")
$dep_title = GetValue $Request "extensionAttribute1"
$dep_title2 = $Request.get("extensionAttribute1")
$code_user = GetValue $Request "sAMAccountName"
$code_user2 = $Request.get("sAMAccountName")
$OU = "OU="+$dep_title2+",OU="+$code_eta2+",OU=Colisee,OU=Usuarios,DC=local,DC=domain,DC=local"
return $OU
}