Page 1 of 1

Performing command line searches on users

Posted: Tue Mar 11, 2008 11:44 pm
by propagandhi
Is there any way to perform the following searches from the command line:

* Search for all users that are not a member of a particular group.
* Search for all users that have permission to send to a particular group.
* Search for all users that havent been logged into the server for a certain time period.

Re: Performing command line searches on users

Posted: Wed Mar 12, 2008 3:44 am
by Valerion
propagandhi wrote:Is there any way to perform the following searches from the command line:

There is always a way if you structure your scripts correctly. Some just take more creative scripting than others :)
propagandhi wrote:I* Search for all users that are not a member of a particular group.

The easiest would be to run omshowpldn on the group to get a list of members, then do a omshowu -m all to get all the users on the system. Any users that are in the second list and not in the first is not in the Group.
propagandhi wrote:I* Search for all users that have permission to send to a particular
group.
omshowaci will give you what you need
propagandhi wrote:I* Search for all users that havent been logged into the server for a certain time period.

Do a omshowu -m all, then for every user returned do a omshowu -n 'User Name/mailnode/CN=Common Name' and check the last logged in time and date in the output.