Anyone know the command for this?
I'm trying to find all users in a particular COS. I know these don't work...
MattCode:zmprov gaa zimbraCOSId theCOS zmprov ga zimbraCOSId theCOS
Anyone know the command for this?
I'm trying to find all users in a particular COS. I know these don't work...
MattCode:zmprov gaa zimbraCOSId theCOS zmprov ga zimbraCOSId theCOS
If you have a large number of users zmprov gaa -v is painful, a faster way to find those in a COS:
zmprov gc default | grep Id
zmprov sa zimbraCOSId=string
-Mike Morse (MCode151)
ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com
Ok so on the speed front some may say it's a minimal advantage, as it's simply not printing all the account info to screen or saving to a file.
(For appearances zmprov sa -v searchValue essentially does the same as zmprov gaa -v | grep something.)
If you have thousands of accounts though that's a big difference, plus it's faster to type, and easier to remember than:
Remember zmprov gaa -v | grep zimbraCOSId just would get a bunch of numbers back, you need the usernames so you have to rearange - searchAccounts is much smoother in spitting out addresses.zmprov gaa -v | grep -e uid: -e zimbraCOSId | grep -B1 putzimbraCOSidStringHERE | grep uid: | awk '{print $2}'
searchAccounts usage : [-v] {ldap-query} [limit {limit}] [offset {offset}] [sortBy {attr}] [attrs {a1,a2...}] [sortAscending 0|1*] [domain {domain}]
---
So the best route to find all users in a COS:
(actually gives you zimbraId but you type zimbraCOSId in the next line)Code:zmprov getCos COSname | grep Id
And you'll get back:Code:zmprov searchAccounts zimbraCOSId=stringFromZimbraId
user@domain.com
user2@domain.com
Last edited by mmorse; 05-27-2008 at 11:30 AM. Reason: in short, 2nd edit: usage values
-Mike Morse (MCode151)
ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com
Doh!...nevermind...remove the '-v' dummy.
Awesome....thanks Mike...I knew there was a way to do that... I forgot about the searchAccount command.
So I can get this to work...
But not this...what am I doing wrong with the "attrs" option?Code:zmprov sa -v zimbraCOSId=5487b59c-de80-4220-a819-07a6a84ed122 | grep uid
MattCode:zmprov sa -v zimbraCOSId=5487b59c-de80-4220-a819-07a6a84ed122 attrs uid
Last edited by Chewie71; 05-27-2008 at 08:55 AM. Reason: I'm a dummy
My copy/paste didn't work above - usage:
zmprov searchAccounts [-v] {ldap-query} [limit {limit}] [offset {offset}] [sortBy {attr}] [attrs {a1,a2...}] [sortAscending 0|1*] [domain {domain}]
While:
Gives:Code:zmprov sa -v zimbraCOSId=string | grep uid
uid: username
And:
Gives:Code:zmprov sa -v zimbraCOSId=string
username@domain.com
But for:
With -v it's a huge list, however -v is supposed to be used there so that it can dump attributes.Code:zmprov sa zimbraCOSId=string attrs uid
But with attrs uid it still gives you:
username@domain.com
And should have given:
username
The command was never corrected/closed out as wontfix: Bug 12759 - zmprov searchAccounts does not return requested attrs
-I suppose if it doesn't work (though it would be useful) we should remove the [attrs {a1,a2...}] from the help![]()
-Mike Morse (MCode151)
ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com
I run this command
#zmprov gc default | grep Id
output :
zimbraFeatureIdentitiesEnabled: TRUE
zimbraId: e00428a1-0c00-11d9-836a-000d93afea2a
zimbraIdentityMaxNumEntries: 20
zimbraMailIdleSessionTimeout: 0
...
so I run next command like this
# zmprov sa zimbraCOSId=e00428a1-0c00-11d9-836a-000d93afea2a
I don't get anything ,I don't know why
Please tell me
There are currently 1 users browsing this thread. (0 members and 1 guests)