From 1fb2f3649d48dceff183ada68c0fac1de108d4cc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 13 Dec 2001 13:19:20 +0000 Subject: added "net ads info" to fetch basic ADS info without any auth (This used to be commit b107ecef7097e4b3b870f51fa6628b870703b4de) --- source3/utils/net_ads.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3/utils/net_ads.c') diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 4f44930038..c67fbda2c8 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -34,12 +34,37 @@ int net_ads_usage(int argc, const char **argv) "\n\tlist users in the realm\n"\ "\nnet ads group"\ "\n\tlist groups in the realm\n"\ +"\nnet ads info"\ +"\n\tshows some info on the server\n"\ "\nnet ads status"\ "\n\tdump the machine account details to stdout\n" ); return -1; } + +static int net_ads_info(int argc, const char **argv) +{ + ADS_STRUCT *ads; + + ads = ads_init(NULL, NULL, NULL, NULL); + ads_connect(ads); + + if (!ads) { + d_printf("Didn't find the ldap server!\n"); + return -1; + } + + d_printf("LDAP server: %s\n", ads->ldap_server); + d_printf("LDAP server name: %s\n", ads->ldap_server_name); + d_printf("Realm: %s\n", ads->realm); + d_printf("Bind Path: %s\n", ads->bind_path); + d_printf("LDAP port: %d\n", ads->ldap_port); + + return 0; +} + + static ADS_STRUCT *ads_startup(void) { ADS_STRUCT *ads; @@ -214,6 +239,7 @@ static int net_ads_join(int argc, const char **argv) int net_ads(int argc, const char **argv) { struct functable func[] = { + {"INFO", net_ads_info}, {"JOIN", net_ads_join}, {"LEAVE", net_ads_leave}, {"STATUS", net_ads_status}, -- cgit