You may also want to try the Microsoft.SqlServer.Smo assembly/namespace.