According to this page
The Sheriff is an officer of the court whose main job is to serve and execute legal processes/mandates issued by the State courts, legal community and the general public. Read More
This Office enforces court mandates and processes including:
The majority of our duties include:
According to Wikipedia
The New York City Sheriff's Office originated in 1626. Each of the city's five county-boroughs had its own Sheriff's Office, each which held the widest law enforcement jurisdiction in its respective county-borough until the New York City consolidation in 1898. Once the city was consolidated, the New York City Police Department took over responsibility for criminal investigations throughout the entire city.
The city sheriff was reorganized as the Office of the Sheriff of the City of New York, effective 1 January 1942. The city's five county sheriffs were abolished and replaced with borough "chief deputies" (later Undersheriffs) reporting to the now mayorally-appointed city-wide sheriff. A contemporary report of the changes emphasized professionalization of the office, which had become notorious for employing political patronage beneficiaries. The new top five commanders were "all college graduates" and "lawyers like their chief, who promises to keep out politics". At the same time, the sheriff's former responsibility for running prisons was transferred to the newly established New York City Department of Correction.