summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2011-09-27 17:46:14 -0700
committerStefan Metzmacher <metze@samba.org>2011-11-27 12:51:56 +0100
commit08ca7d1634a6510655581bce141fb0200dad8c1c (patch)
treec088aa6fd19f7c48ebd418f05f9b6442b829ced7 /source4
parent521c708fe45ab0d8b9e31391cc8b8aae59e0c27f (diff)
downloadsamba-08ca7d1634a6510655581bce141fb0200dad8c1c.tar.gz
samba-08ca7d1634a6510655581bce141fb0200dad8c1c.tar.bz2
samba-08ca7d1634a6510655581bce141fb0200dad8c1c.zip
samba-tool: add a domain info command to get basic info
Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/netcmd/domain.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py
index 0e6083a8b0..4006a41eb0 100644
--- a/source4/scripting/python/samba/netcmd/domain.py
+++ b/source4/scripting/python/samba/netcmd/domain.py
@@ -41,6 +41,7 @@ from samba.netcmd import (
SuperCommand,
Option
)
+from samba.netcmd.common import netcmd_get_domain_infos_via_cldap
from samba.samba3 import Samba3
from samba.samba3 import param as s3param
from samba.upgrade import upgrade_from_samba3
@@ -74,6 +75,28 @@ class cmd_domain_export_keytab(Command):
net = Net(None, lp, server=credopts.ipaddress)
net.export_keytab(keytab=keytab)
+class cmd_domain_info(Command):
+ """Print basic info about a domain and the DC passed as parameter"""
+
+ synopsis = "%prog domain info <ip_address> [options]"
+
+ takes_options = [
+ ]
+
+ takes_args = ["address"]
+
+ def run(self, address, credopts=None, sambaopts=None, versionopts=None):
+ lp = sambaopts.get_loadparm()
+ res = netcmd_get_domain_infos_via_cldap(lp, None, address)
+ if res:
+ print "Forest : %s" % res.forest
+ print "Domain : %s" % res.dns_domain
+ print "Netbios domain : %s" % res.domain_name
+ print "DC name : %s" % res.pdc_dns_name
+ print "DC netbios name : %s" % res.pdc_name
+ print "Server site : %s" % res.server_site
+ print "Client site : %s" % res.client_site
+
class cmd_domain_join(Command):
@@ -614,12 +637,12 @@ class cmd_domain_samba3upgrade(Command):
upgrade_from_samba3(samba3, logger, targetdir, session_info=system_session(),
useeadb=eadb)
-
class cmd_domain(SuperCommand):
"""Domain management"""
subcommands = {}
subcommands["exportkeytab"] = cmd_domain_export_keytab()
+ subcommands["info"] = cmd_domain_info()
subcommands["join"] = cmd_domain_join()
subcommands["level"] = cmd_domain_level()
subcommands["passwordsettings"] = cmd_domain_passwordsettings()