From the official Senate website....
The Sergeant at Arms and Doorkeeper, elected by the members, serves as the protocol and chief law enforcement officer and is the principal administrative manager for most support services in the United States Senate.
When the first Congress convened in 1789, the Office of Doorkeeper was established to address the single most pressing problem confronting the Senate at its birth - its inability to keep a majority of members in the Capitol long enough to organize and begin the business of government.
A doorkeeper was also necessary to control access to the Senate sessions, which were private for the first six years. Later, when the sessions were open to the public, the doorkeeper was responsible for maintaining order on the floor of the Senate and in the galleries. The title of Sergeant at Arms was added in 1798 to reflect the expanded administrative duties of the position.
The protocol responsibilities include escorting the President and other heads of state or official guests of the Senate who are attending official functions in the Capitol; making arrangements for funerals of senators who die in office; assisting in plans for the inauguration of the President and organizing the swearing-in and orientation programs for newly elected senators. The Sergeant at Arms leads the senators from the Senate to the House chamber for joint sessions of Congress, to the presidential inaugural platform, or wherever the Senate may go as a body. As executive officer, the Sergeant at Arms has custody of the Senate gavel.
As chief law enforcement officer of the Senate, the Sergeant at Arms is charged with maintaining security in the Capitol and all Senate buildings, as well as protection of the members themselves. The Sergeant at Arms serves as the executive officer of the Senate for enforcement of all rules of the Committee on Rules and Administration regulating the Senate Wing of the Capitol and the Senate Office Buildings and has responsibility for and immediate supervision of the Senate floor, chamber and galleries. The Sergeant at Arms is authorized to arrest and detain any person violating Senate rules, including the President of the United States.
The Sergeant at Arms is the largest in size of staff and budget in the Senate. It is responsible for all Senate computers and technology support services, recording and photographic services, printing and graphics services, and telecommunications services. The Sergeant at Arms also provides assistance to all Senate offices with their staffing, mailing, purchasing and financial needs. The Sergeant at Arms offices responsible for providing these and other services include Capitol Facilities, the Operations Division, Customer Relations, Financial Operations, Human Resources, and Information Security. The Sergeant at Arms also shares responsibility for the U.S. Capitol Police, the Capitol Guide Service, the Senate Page Program, the Senate Office of Education and Training and the Capitol Switchboard.