summaryrefslogtreecommitdiff
path: root/source4/scripting/bin
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/bin')
-rwxr-xr-xsource4/scripting/bin/rpcclient90
1 files changed, 45 insertions, 45 deletions
diff --git a/source4/scripting/bin/rpcclient b/source4/scripting/bin/rpcclient
index 68b33fe638..871dc74bcf 100755
--- a/source4/scripting/bin/rpcclient
+++ b/source4/scripting/bin/rpcclient
@@ -23,7 +23,7 @@ def swig2dict(obj):
if attr == 'this' or attr == 'thisown':
continue
-
+
result[attr] = getattr(obj, attr)
return result
@@ -51,7 +51,7 @@ class rpcclient(Cmd):
Cmd.onecmd(self, line)
except dcerpc.NTSTATUS, arg:
print 'The command returned an error: %s' % arg[1]
-
+
# Command handlers
def do_help(self, line):
@@ -67,7 +67,7 @@ class rpcclient(Cmd):
print 'Command exited with code %d' % os.WEXITSTATUS(status)
else:
print 'Command exited with signal %d' % os.WTERMSIG(status)
-
+
def do_EOF(self, line):
"""Exits rpcclient."""
print
@@ -77,7 +77,7 @@ class rpcclient(Cmd):
def do_SamrEnumDomains(self, line):
"""Enumerate domain names."""
-
+
usage = 'usage: SamrEnumDomains'
if line != '':
@@ -116,16 +116,16 @@ class rpcclient(Cmd):
print connect_handle.LookupDomain(args[0])
def do_SamrQueryDomInfo(self, line):
- """Return information about a domain designated by its SID."""
+ """Return information about a domain designated by its SID."""
- usage = 'SamrQueryDomInfo DOMAIN_SID [info_level]'
+ usage = 'SamrQueryDomInfo DOMAIN_SID [info_level]'
- parser = OptionParser(usage)
- options, args = parser.parse_args(string.split(line))
+ parser = OptionParser(usage)
+ options, args = parser.parse_args(string.split(line))
- if (len(args) == 0) or (len(args) > 2):
- print 'usage:', usage
- return
+ if (len(args) == 0) or (len(args) > 2):
+ print 'usage:', usage
+ return
pipe = dcerpc.pipe_connect(
'ncacn_np:%s' % self.server,
@@ -133,26 +133,26 @@ class rpcclient(Cmd):
self.cred)
connect_handle = samr.Connect(pipe)
- domain_handle = connect_handle.OpenDomain(args[0])
+ domain_handle = connect_handle.OpenDomain(args[0])
- if (len(args) == 2):
- result = domain_handle.QueryDomainInfo(int(args[1]))
- else:
- result = domain_handle.QueryDomainInfo()
+ if (len(args) == 2):
+ result = domain_handle.QueryDomainInfo(int(args[1]))
+ else:
+ result = domain_handle.QueryDomainInfo()
pprint(swig2dict(result))
def do_SamrQueryDomInfo2(self, line):
- """Return information about a domain designated by its SID.
+ """Return information about a domain designated by its SID.
(Windows 2000 and >)"""
- usage = 'SamrQueryDomInfo2 DOMAIN_SID [info_level] (Windows 2000 and >)'
- parser = OptionParser(usage)
- options, args = parser.parse_args(string.split(line))
+ usage = 'SamrQueryDomInfo2 DOMAIN_SID [info_level] (Windows 2000 and >)'
+ parser = OptionParser(usage)
+ options, args = parser.parse_args(string.split(line))
- if len(args) == 0 or len(args) > 2:
- print 'usage:', usage
- return
+ if len(args) == 0 or len(args) > 2:
+ print 'usage:', usage
+ return
pipe = dcerpc.pipe_connect(
'ncacn_np:%s' % self.server,
@@ -160,19 +160,19 @@ class rpcclient(Cmd):
self.cred)
connect_handle = samr.Connect(pipe)
- domain_handle = connect_handle.OpenDomain(args[0])
+ domain_handle = connect_handle.OpenDomain(args[0])
- if (len(args) == 2):
- result = domain_handle.QueryDomainInfo2(int(args[1]))
- else:
- result = domain_handle.QueryDomainInfo2()
+ if (len(args) == 2):
+ result = domain_handle.QueryDomainInfo2(int(args[1]))
+ else:
+ result = domain_handle.QueryDomainInfo2()
pprint(swig2dict(result))
def do_SamrEnumDomainGroups(self, line):
- """Return the list of groups of a domain designated by its SID."""
+ """Return the list of groups of a domain designated by its SID."""
- usage = 'SamrEnumDomainGroups DOMAIN_SID'
+ usage = 'SamrEnumDomainGroups DOMAIN_SID'
parser = OptionParser(usage)
options, args = parser.parse_args(string.split(line))
@@ -186,10 +186,10 @@ class rpcclient(Cmd):
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
self.cred)
- connect_handle = samr.Connect(pipe)
- domain_handle = connect_handle.OpenDomain(args[0])
+ connect_handle = samr.Connect(pipe)
+ domain_handle = connect_handle.OpenDomain(args[0])
- result = domain_handle.EnumDomainGroups()
+ result = domain_handle.EnumDomainGroups()
pprint(result)
@@ -197,7 +197,7 @@ class rpcclient(Cmd):
"""Return the list of aliases (local groups) of a domain designated
by its SID."""
- usage = 'SamrEnumDomainAliases DOMAIN_SID'
+ usage = 'SamrEnumDomainAliases DOMAIN_SID'
parser = OptionParser(usage)
options, args = parser.parse_args(string.split(line))
@@ -214,21 +214,21 @@ class rpcclient(Cmd):
connect_handle = samr.Connect(pipe)
domain_handle = connect_handle.OpenDomain(args[0])
- result = domain_handle.EnumDomainAliases()
+ result = domain_handle.EnumDomainAliases()
pprint(result)
def do_SamrEnumDomainUsers(self, line):
- """Return the list of users of a domain designated by its SID."""
+ """Return the list of users of a domain designated by its SID."""
- usage = 'SamrEnumDomainUsers DOMAIN_SID [user_account_flags]'
+ usage = 'SamrEnumDomainUsers DOMAIN_SID [user_account_flags]'
parser = OptionParser(usage)
options, args = parser.parse_args(string.split(line))
- if (len(args) == 0) or (len(args) > 2):
- print 'usage:', usage
- return
+ if (len(args) == 0) or (len(args) > 2):
+ print 'usage:', usage
+ return
pipe = dcerpc.pipe_connect(
'ncacn_np:%s' % self.server,
@@ -238,10 +238,10 @@ class rpcclient(Cmd):
connect_handle = samr.Connect(pipe)
domain_handle = connect_handle.OpenDomain(args[0])
- if (len(args) == 2):
- result = domain_handle.EnumDomainUsers(int(args[1]))
- else:
- result = domain_handle.EnumDomainUsers()
+ if (len(args) == 2):
+ result = domain_handle.EnumDomainUsers(int(args[1]))
+ else:
+ result = domain_handle.EnumDomainUsers()
pprint(result)
@@ -288,7 +288,7 @@ if __name__ == '__main__':
username = options.username
if username != '':
- cred = (domain, username, password)
+ cred = (domain, username, password)
# Run command loop