Showing posts with label Linked Server. Show all posts
Showing posts with label Linked Server. Show all posts

Wednesday, October 7, 2009

Finding Linked Servers with Open Mappings to SA

Recently I've been working on implementing PBM (Policy Based Management) in our environment. In addition to using the predefined conditions & facets I've been creating custom Policies using executesql().

As part of this effort we wanted a policy to alert us to Linked Servers with an open mapping to SA. Since this isn't something that was really obvious it seemed worthy of a quick post. There are 2 versions of the code, one for SQL2000 & one for SQL2005. The code is written with PBM in mind so parses as one string, you can take this code out & it will still work just fine. The code is here.

Don't forget SQLSaturday #21 in Orlando is less than 2 weeks away.