How can I find which user owns a GUID?

Hello,


I am in the process of migrating some users from an old Snow Leopard Server and I am working on migrating calendars right now. My problem is that there are many calendars set up for users that either no longer use them or for users that have left our organization, I am trying to determine some way to find only those calendars that have been updated in the last few months or so. I have found that I can do this relatively easily by doing a recursive directory listing on the calendar store folder sorted by time and this does help me easily find which calendars have been updated recently, however instead of a user name for a calendar, I only have the user's GUID.


So, the question becomes, if I know the GUID for a user (formatted like B7D23BBF-97D9-476B-B254-0F46ECAC9EB9) is there an easy way to find what user that GUID is associated with?


Thanks in advance.

Posted on Nov 17, 2014 12:04 PM

Reply
2 replies

Nov 17, 2014 3:02 PM in response to roarkh

I figured this out, in case it is helpful to someone else I used the ldapsearch command from the command line as follows (replacing our actual server name with macserver.example.com for this example)...


ldapsearch -h macserver.example.com -x -b "cn=users,dc=macserver,dc=example,dc=com" "apple-generateduid=B7D23BBF-97D9-476B-B254-0F46ECAC9EB9"


This returns a bunch of information including the name of the user associated with the ID that was searched for.

Dec 24, 2014 2:21 PM in response to roarkh

That command did not work for me, but I was able to use the following command to match a user to their GUID:


dscl localhost -read /Search/Users/<username> | grep GeneratedUID | cut -c15-


The username is the user's short name. I used this to restore emails for a user from a Time Machine backup. The GUID folders were located here:


library/server/mail/data/mail


In case anyone might be looking for how to do this, move the contents of the backup GUID folder to the current GUID folder for the user and make sure _dovecot has rights to it all afterwards.


Cheers

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I find which user owns a GUID?

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