You are viewing limited content. For full access, please sign in.

Discussion

Discussion

License manager - Add User

SDK
posted on September 23, 2024

We are trying to add a user to LFDS via SDK script using the License Manager object. We call GetAllUsers() method to get all users to see if user exists first before adding. But, that times out in workflow. Any other methods how we can check and add user in SDK script?

0 0
replied on September 23, 2024

If you can wait a few months, Workflow 12 is adding native Directory Server user management activities so you don't have to write SDK scripts for this sort of "Create user" task.

Why do you need to call GetAllUsers to check if a specific user exists though? I believe you have in the hundreds of thousands of users. That's never going to be performant, even if it doesn't time out.

Do something like call GetUser in a try/catch and check if it fails with a "User doesn't exist" type error code. I don't know exactly what it returns - put in a known invalid value and test.

//Retrieve an LFDS user by user name. The user is in the ROOT LFDS organization. 
​​​​​​​User LFDSUser = db.GetUser("user name value", "ROOT"); 

Alternatively, in a try/catch, try to create the user without checking if it exists first and check for a "User already exists" type error response.

0 0
replied on September 24, 2024

Thanks Sam. I think we can wait for Workflow 12. This is awesome to know!! Thanks again.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.