Snippets and Functions for Server side code.
Looking up the sys_id of a server for server-side activites
The below two scripts detail an inline and function based option for looking up a server sys_id. The inline option is for windows servers while the function will lookup servers of any type. You can find some more details at this blog post