[p4] admin - removing user from multiple groups

Wright, Richard richardw at cobaltgroup.com
Fri Feb 24 11:59:24 PST 2006


By the way, if you are using a recent version of Perforce (2004.2+, I
believe), you can count how many groups a user is in with the following:

p4 -ztag groups | grep user | sort | uniq -c

For anyone looking to attack this problem or similar problems, take a look a
the -ztag (or -G or -R for Python or Ruby) output of p4 groups in the recent
servers.  You can get a great deal of info out of it quickly.

-Rick

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com]On Behalf Of Weintraub, David
Sent: Friday, February 24, 2006 10:35 AM
To: sally.page at symbian.com; perforce-user at perforce.com
Subject: Re: [p4] admin - removing user from multiple groups


Here's a simple shell script that counts the number of groups each user
is in:

p4 users | awk '{print $1}' | while read user
do
    printf "User %s: " $user
    p4 groups $user | wc -l
done

The question I have is what if you find a user is in more than one
group? Which group do they stay in? Anyway, this will give you a start.

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of
sally.page at symbian.com
Sent: Friday, February 24, 2006 6:27 AM
To: perforce-user at perforce.com
Subject: [p4] admin - removing user from multiple groups

Hi

Anyone got a Perl or Python script  that removes a user from being a
member of multiple groups, its part of a housekeeping excersise, just
got lots to do quickly, and not being a very good script writer at all
it'll take me longer to write it myself than do the work, so thought I'd
ask those that are good, or may have one already :-)

Many thanks

Sally Page
Configuration Management Engineer, Delivery Services Symbian Software
(UK) Ltd
Direct: +44 (0) 20 7154 1912
Mobile: +44 (0) 7769 588915



-----------------------------------------
**********************************************************************
Symbian Software Ltd is a company registered in England and Wales with
registered number 4190020 and registered office at 2-6 Boundary Row,
Southwark, London,  SE1 8HP, UK. This message is intended only for use
by the named addressee and may contain privileged and/or confidential
information. If you are not the named addressee you should not
disseminate, copy or take any action in reliance on it. If you have
received this message in error please notify postmaster at symbian.com and
delete the message and any attachments accompanying it immediately.
Neither Symbian nor any of its Affiliates accepts liability for any
corruption, interception, amendment, tampering or viruses occurring to
this message in transit or for any message sent by its employees which
is not in compliance with Symbian corporate policy.
**********************************************************************
_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user
_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user



More information about the perforce-user mailing list