RepositoryGetUsers Method (Options, String)
|
Get a list of users from the repository
Namespace:
Perforce.P4
Assembly:
p4api.net (in p4api.net.dll) Version: 2024.1.261.8274
Syntaxpublic IList<User> GetUsers(
Options options,
params string[] user
)
Public Function GetUsers (
options As Options,
ParamArray user As String()
) As IList(Of User)
public:
IList<User^>^ GetUsers(
Options^ options,
... array<String^>^ user
)
member GetUsers :
options : Options *
user : string[] -> IList<User>
Parameters
- options
- Type: Perforce.P4Options
Options for the users command. See: UsersCmdFlags - user
- Type: SystemString
Optional list of users.
Return Value
Type:
IListUserA list containing the matching users
Remarks
p4 help users
users -- List Perforce users
p4 users [-l -a -r -c] [-m max] [user ...]
Lists all Perforce users or users that match the 'user' argument.
The report includes the last time that each user accessed the system.
The -m max flag limits output to the first 'max' number of users.
The -a flag includes service and operator users in the output.
The -l flag includes additional information in the output. The -l
flag requires 'super' access, which is granted by 'p4 protect'.
The -r and -c flags are only allowed on replica servers. When
-r is given only users who have used a replica are reported and
when -c is given only the user information from the central server
is reported. Otherwise on a replica server, the user list will
be slightly different from the master server as the user access times
will reflect replica usage or master usage whichever is newer.
Examples
To get the first 10 users that start with the letter 'A':
UsersCmdOptions opts = new UsersCmdOptions(UsersCmdFlags.None, 10);
IList<User> users = Repository.getUsers(opts, "A*");
To get the users for 'Bob', 'Ted', 'Carol' and 'Alice':
UsersCmdOptions opts = new UsersCmdOptions(UsersCmdFlags.None, -1);
IList<User> users = Repository.getUsers(opts, "Bob", "Ted", "Carol", "Alice");
To get all the users (WARNING, will fetch all users from the repository):
UsersCmdOptions opts = new UsersCmdOptions(UsersCmdFlags.IncludeAll, -1);
IList<User> users = Repository.getUsers(opts, null);
See Also