# Active Directory Sync

**URL:** https://forum.novacura.com/t/active-directory-sync/907
**Category:** Flow Classic
**Tags:** studio-or-server
**Created:** [March 25, 2025, 5:05pm UTC](https://forum.novacura.com/t/active-directory-sync/907 "2025-03-25T17:05:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![damian\_connaughton](https://avatars.discourse-cdn.com/v4/letter/d/7C9FD7/32.png) [@damian\_connaughton](https://forum.novacura.com/u/damian_connaughton)
#### Post date: [March 25, 2025, 5:05pm UTC](https://forum.novacura.com/t/active-directory-sync/907/1 "2025-03-25T17:05:36Z")

</div>

We are using Active Directory Sync to pull AD users that are in particular groups into Novacura - one of the groups isn’t required any more, so one option would be to remove that group from the sync, but another option would be to set all those users as inactive (and free up licences), whilst keeping the history of all those users, in case they need to be reactivated in the future - is this possible using FlowScript? I found this function in the help:

exec SetActive(enabled);

Is there something similar to set these users to Inactive? I tried

exec SetActive(disabled);

but that returned an error

---

<div class="post-metadata">

### Author: ![paphus](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/paphus/32/27_2.png) [@paphus](https://forum.novacura.com/u/paphus)
#### Post date: [March 26, 2025, 12:41pm UTC](https://forum.novacura.com/t/active-directory-sync/907/2 "2025-03-26T12:41:21Z")

</div>

Damian, what happens if you do not put in the exec SetActive(enabled); command into the AD Script. Do the users stay in active status after you trigger the sync?

---

<div class="post-metadata">

### Author: ![damian\_connaughton](https://avatars.discourse-cdn.com/v4/letter/d/7C9FD7/32.png) [@damian\_connaughton](https://forum.novacura.com/u/damian_connaughton)
#### Post date: [March 26, 2025, 1:21pm UTC](https://forum.novacura.com/t/active-directory-sync/907/3 "2025-03-26T13:21:55Z")

</div>

Hi there - at the moment we don’t have that function in the Flow Script, we just have this:

exec SetUserType(‘FullUser’);

and new users are set up as Active without any other functions. I looked at the help documentation and found that there is a SetActive function, so I assumed that this would be able to switch a user between Active and Inactive. It would be much more preferable if I could do this for all users than have to manually inactivate each user

---

<div class="post-metadata">

### Author: ![ivstde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/ivstde/32/146_2.png) [@ivstde](https://forum.novacura.com/u/ivstde)
#### Post date: [March 26, 2025, 3:33pm UTC](https://forum.novacura.com/t/active-directory-sync/907/4 "2025-03-26T15:33:27Z")

</div>

Hi,

i think the syntax is exec SetActive(‘TRUE’) and SetActive(‘FALSE’)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/454f1396f9835051050452f090c8873277936397.png)

Hope this helps!

B R  
Ivan

---

<div class="post-metadata">

### Author: ![damian\_connaughton](https://avatars.discourse-cdn.com/v4/letter/d/7C9FD7/32.png) [@damian\_connaughton](https://forum.novacura.com/u/damian_connaughton)
#### Post date: [March 26, 2025, 4:59pm UTC](https://forum.novacura.com/t/active-directory-sync/907/5 "2025-03-26T16:59:24Z")

</div>

Hi Ivan - thanks for this, it worked perfectly!
