Hi venkateswararao-9381,
First, I create three local users in User list of Computer Management window(Test, Test1,Test2).
And then made a test with your code example. They all returned true.
So you need to check the differences of Users.
What is error message returned when it doesn’t work? Could you provide more details?
Meanwhile, when I created the user, I did not check the following checkboxes.
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.