using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Management.Smo;
namespace LoginInfo
{
    class Program
    {
        static void Main(string[] args)
        {
            Server local = new Server("(local)");
            foreach (Login login in local.Logins)
            {
               
                ObjectPermissionInfo[] perms = login.EnumObjectPermissions();
                foreach (ObjectPermissionInfo opi in perms)
                {
                    Console.WriteLine(opi.ObjectName);
                }
                foreach (Property p in login.Properties)
                {
                    Console.WriteLine(p.Name);
                }
            }
        }
    }
}
