Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

local users groups deleted, still show in profile manager

Added a bunch of user groups but meant for them to be network and local users and not just local users. So we deleted them.


Then we settled on a single group. This single group was a network user group.


However, in profile manager the old deleted groups still show. Some names we want to reuse potentially - how do we get them removed from the profile manager?


OS/X 10.9, Server 3.1.1

MacBook Pro, OS X Mavericks (10.9)

Posted on Apr 4, 2014 12:16 PM

Reply
7 replies

Jun 20, 2014 1:04 PM in response to Pangolin1

I ran into the same issue in Mavericks Server and tried this:


OS X Server: How to reset Profile Manager to its original state


I used the command indicated for Mountain Lion and it seemed to do the trick. Once I restarted PM and ran the Device Management setup, the deleted groups had been removed and the current groups were properly added. Buyer beware of course - this was done on a test server, not on a production server, so use it at your own risk :-)

Jul 10, 2014 9:57 AM in response to Pangolin1

pepmachine's answer is correct..that will work, but is awfully annoying.


Here is a way I have found to work...attempt at your own risk:


READ THE WHOLE POST BEFORE EXECUTING ANY COMMANDS 🙂


In Terminal:

sudo psql -U _devicemgr -d devicemgr_v2m0 -h /Library/Server/ProfileManager/Config/var/PostgreSQL/


The above connects to the devicemgr_v2m0 database, which is the Profile Manager database in 3.1.1. This is different in different versions of OSX Server, so you may need to google for the proper connection strings on something other than 10.9/3.1.1.


Then, in devicemgr_v2m0=# prompt type:

DELETE FROM public.inactive_users WHERE inactive_users.od_node_id = 1;


You should then see a response (where # = number of rows that were deleted)

DELETE #


Type the following to quit

\q


The logic behind the query is that the users are still showing because they are listed in the inactive_users table even though they were deleted from the system. Only users who did NOT have settings associated with them linger. If you had a user who had a payload associated with them, then that user should disappear from PM when you delete them.


The od_node_id appears to indicate what source the users came from.

1 = Local Users

2 = Local Network Users

3+ Would appear to be network sources like bound LDAP/AD domains (I have only a #4 for a bound AD domain).


I believe it is *probably* safe to actually delete all users, as any users which still exist will show back up when you refresh the list in PB. To do this you could just issue:

DELETE FROM public.inactive_users


The caveats with this may be:

1) PM has to rebuild a larger list of users, this may take some time (?)

2) If the users were somehow attached to something this might break that connection. Although I don't think this is an issue because it appears that users who are attached to something (like a payload) would properly get deleted anyway as mentioned above.


To do this for groups, do the same things except replace all instances of


inactive_users

with

inactive_user_groups

Again, use this at your own risk.

Jul 10, 2014 10:38 AM in response to BJH75

Wow...didn't realize you couldn't edit a post....how dangerous!!


Anyway, I wanted to correct/clarify some of my post above regarding the od_node_id


It appears that the numbers here are not as static as I thought, they can change depending on your configuration.


So, what you need to do is FIRST execute this command:

In Terminal:

sudo psql -U _devicemgr -d devicemgr_v2m0 -h /Library/Server/ProfileManager/Config/var/PostgreSQL/

Then, in devicemgr_v2m0=# prompt type:

SELECT od_nodes.od_node_id, od_nodes.od_node_name FROM public.od_nodes;


This will return data like the following:


od_node_id | od_node_name

------------+----------------------------

1 | /Local/Default

2 | /Active Directory/AMERICAS

3 | /LDAPv3/127.0.0.1


/Local/Default = Local Users. In this case then I would use 1 for my od_node_id in the DELETE statement.

/Active Directory/AMERICAS = My bound AD domain. In this case then I would use 2 for my od_node_id in the DELETE statement.

/LDAPv3/127.0.0.1 = Local Network (OD) Users. In this case then I would use 3 for my od_node_id in the DELETE statement.


So, make sure you use the right # or you will delete the wrong users.

Again, as I stated in my above post, it is *probably* safe even if you delete all of these users - after all they are inactive and appear to regenerate if still extant.

local users groups deleted, still show in profile manager

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.