Adding an sql script os it will run on a schedule

Hello,

I'm trying to integrate an sql script* that will update the person central account name which in turn will update ADSAccount samaccountname and AD via the connector.

When I manually change Person's central account name it works but when I run the script on object browser it doesn't triggers and ADSaccount update process.

I was told that this is expected and that I will need to integrate the script in OIM for it to work the same way as when I set it manually.

My question is   how can I achieve that? 

*with person_cte as (
Select
Person.UID_Person,
Person.CentralAccount,
Person.IsInActive,
ADSAccount.SAMAccountName,
Person.ExitDate,
replace(Person.CentralAccount, '.','_') as new_account
From
Person Inner Join
ADSAccount On ADSAccount.UID_Person = Person.UID_Person
Where
Person.IsInActive = 1 And
ADSAccount.SAMAccountName Not Like N'%[_]%' And
ADSAccount.SAMAccountName Like N'%[.]%' And
Person.ExitDate < GetDate() - 180
)
--select * from person_cte

merge Person target using person_cte source on target.UID_Person=source.UID_Person
when matched
then update set target.CentralAccount= source.new_account;

Top Replies