--- title: "system.roster.getRosters" description: "Returns a dictionary of rosters, where the key is the name of the roster, and the value is an array list of string user names." --- # system.roster.getRosters > Returns a dictionary of rosters, where the key is the name of the roster, and the value is an array list of string user names. This function is used in **Python Scripting**. ## Description This function was designed to run in the Gateway and in Perspective sessions. If creating rosters from Vision clients, use [system.alarm.getRosters](../system-alarm/system-alarm-getRosters.md) instead. ## Syntax `system.roster.getRosters()` ### Parameters Nothing ### Returns **Dictionary[String, List[String]]** - A dictionary that maps roster names to a list of usernames in the roster. The list of usernames may be empty if no users have been added to the roster. ### Scope Gateway, Perspective Session ## Code Examples ```python title="Code Snippet" # This example prints out all existing rosters to the console of a Perspective session: rosters = system.roster.getRosters() # Iterate over the rosters, extracting the name and user lists. for name, users in rosters.items(): # Format the results in a somewhat presentable manner. msg = "{0} : {1}".format(name, users) # Output the result. system.perspective.print(msg) ``` ```python title="Get Each User in a Roster" # This example prints out each user in a certain roster. rosters = system.roster.getRosters() # Specify the roster with the key (the name of the roster), and iterate over the users. for user in rosters['myRoster']: # Output the users. system.perspective.print(user) ```