<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>User created programmatically doesn't show in Control panel</title>
  <link rel="self" href="https://liferay.dev/sv/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=123532856" />
  <subtitle>User created programmatically doesn't show in Control panel</subtitle>
  <id>https://liferay.dev/sv/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=123532856</id>
  <updated>2026-04-17T07:40:07Z</updated>
  <dc:date>2026-04-17T07:40:07Z</dc:date>
  <entry>
    <title>RE: User created programmatically doesn't show in Control panel</title>
    <link rel="alternate" href="https://liferay.dev/sv/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123619483" />
    <author>
      <name>Nikhil Nishchal</name>
    </author>
    <id>https://liferay.dev/sv/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123619483</id>
    <updated>2025-11-25T12:02:10Z</updated>
    <published>2025-09-03T09:20:18Z</published>
    <summary type="html">&lt;p&gt;Hi Illés Ákos,&lt;br&gt; Service context you can create and add there.
  Could you please match created user data with existing user in DB like
  group id , company id etc.&lt;br&gt; Also, Please enable the log to get if
  there is any exception.&lt;br&gt;
  &lt;br&gt; Thanks!&lt;/p&gt;</summary>
    <dc:creator>Nikhil Nishchal</dc:creator>
    <dc:date>2025-09-03T09:20:18Z</dc:date>
  </entry>
  <entry>
    <title>User created programmatically doesn't show in Control panel</title>
    <link rel="alternate" href="https://liferay.dev/sv/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123532855" />
    <author>
      <name>Illés Ákos</name>
    </author>
    <id>https://liferay.dev/sv/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123532855</id>
    <updated>2025-08-08T17:08:23Z</updated>
    <published>2025-08-05T09:32:50Z</published>
    <summary type="html">&lt;p&gt;Hi Everyone!&lt;/p&gt;
&lt;p&gt;I'm using Liferay CE 7.4.3-112 version and I'm trying to create a
  custom job, that adds users to Liferay. My problem is, that after
  adding user with &lt;/p&gt;
&lt;pre&gt;
UserLocalServiceUtil.addUserWithWorkflow() or addUser() &lt;/pre&gt;
&lt;p&gt;the user gets created in the database, but it is not showing in the
  Control Panel-&amp;gt;Users and Organizations panel, not even after
  reindexing everything. The created user in the database seems exactly
  the same as users before, that are showing just fine.&lt;/p&gt;
&lt;p&gt;Here is my code for adding the user:&lt;/p&gt;
&lt;pre&gt;
String randomPassword = UUID.randomUUID().toString();
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(20098);
serviceContext.setUserId(_configuration.userId());
serviceContext.setAddGuestPermissions(true);
serviceContext.setIndexingEnabled(true);
User user;
try{
    user = UserLocalServiceUtil.addUserWithWorkflow(
            _configuration.userId(), // e.g., default company admin userId
            20098,
            false, // autoPassword = false
            randomPassword,
            randomPassword,
            false, // autoScreenName = false
            &amp;quot;john.doe&amp;quot;, //screenName
            &amp;quot;john.doe@example.com&amp;quot;, //emailAddress
            LocaleUtil.getDefault(),
            &amp;quot;John&amp;quot;, // first name
            &amp;quot;&amp;quot;, // middle name
            &amp;quot;Doe&amp;quot;, // last name
            0, 0, true, // prefix/suffix/male
            1, 26, 2002, // birthday, month, day, year
            &amp;quot;Developer&amp;quot;, // job title
            AzureLiferayUserSyncPortletKeys.AZUREUSERTYPE,
            null, // List of group IDs
            null, // List of organization IDs
            null, // List of role IDs
            null, // List of user group IDs
            false, // sendEmail
            serviceContext // ServiceContext
    );

} catch (Exception e) {
    throw new RuntimeException(e);
}&lt;/pre&gt;
&lt;p&gt;I don't really understand the what the ServiceContext do in this
  scenario, the things I set are mainly from other forum posts in a
  similar context. I'm new to Liferay development, please help.&lt;/p&gt;</summary>
    <dc:creator>Illés Ákos</dc:creator>
    <dc:date>2025-08-05T09:32:50Z</dc:date>
  </entry>
</feed>
