A UPS can power the server or PC for a length of time - it depends on how much power the PC draws, and how much energy is in the batteries. When AC power is removed, the UPS generates it from its batteries, and when the battery voltage declines to the point where the unit can't maintain the specified output voltage, it will shut down. Before that happens, it will send a signal via a USB or Serial connection to a connected computer, and there is software that comes with the UPS, that runs on the computer, that will shut the computer down on the signal from the UPS. The Server can be set to automatically start when it gets power again. If you want a longer runtime on batteries, you get a UPS with a higher Volt-Amp rating, or get one where you can add external batteries. American Power Conversions has an extensive line of UPSs.
There are also UPS's designed for 911 call centers and such, that have an external generator that will kick on and keep the batteries charged, for runtime measured in weeks rather than hours or minutes. It all depends on what you need to do, and your budget.
Fred Wagner