Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def get_group_details(name, domain=domain_name, username =username, password=password,
- domain_name=domain_name):
- compiled_search_base = 'DC='+domain+',DC=abc,DC=com'
- compiled_search_filter = "(&(objectClass=group)(samaccountname=%s))" % name
- server = Server(server_name, get_info=ALL)
- connectionusername = 'CN=' + username + ',OU=SelfService,OU=Service Accounts,OU=FISC,OU=SystemsCo,DC=%s,DC=abc,'
- 'DC=com' %(domain_name)
- c = Connection(server, connectionusername, password, authentication='SIMPLE', auto_bind=True)
- c.search(search_base=compiled_search_base, search_filter=compiled_search_filter,search_scope=SUBTREE, attributes=['cn', 'member'], size_limit=0)
- member_list=[]
- for entry in c.response:
- member_list.extend(entry['attributes']['member'])
- return member_list
- task_list =[]
- for group in list_of_groups:
- task = asyncio.ensure_future(get_group_details(group))
- task_list.append(task)
- master_out = await asyncio.gather(*task_list)
- Traceback (most recent call last):
- File "/usr/local/lib/python3.7/site-packages/ldap3/strategy/base.py", line 823, in sending
- self.connection.socket.sendall(encoded_message)
- File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1015, in sendall
- v = self.send(byte_view[count:])
- File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 984, in send
- return self._sslobj.write(data)
- BrokenPipeError: [Errno 32] Broken pipe
- During handling of the above exception, another exception occurred:
- Traceback (most recent call last):
- File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
- last_expr = (await self._async_exec(code_obj, self.user_ns))
- File "<ipython-input-233-5497fdd3fed2>", line 4, in async-def-wrapper
- File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
- last_expr = (await self._async_exec(code_obj, self.user_ns))
- File "<ipython-input-228-5497fdd3fed2>", line 4, in async-def-wrapper
- File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
- last_expr = (await self._async_exec(code_obj, self.user_ns))
- File "<ipython-input-225-5497fdd3fed2>", line 4, in async-def-wrapper
- File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
- last_expr = (await self._async_exec(code_obj, self.user_ns))
- File "<ipython-input-215-5497fdd3fed2>", line 4, in async-def-wrapper
- File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
- last_expr = (await self._async_exec(code_obj, self.user_ns))
- File "<ipython-input-202-5497fdd3fed2>", line 4, in async-def-wrapper
- File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
- last_expr = (await self._async_exec(code_obj, self.user_ns))
- File "<ipython-input-194-5497fdd3fed2>", line 4, in async-def-wrapper
- File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
- last_expr = (await self._async_exec(code_obj, self.user_ns))
- File "<ipython-input-190-5497fdd3fed2>", line 4, in async-def-wrapper
- File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
- last_expr = (await self._async_exec(code_obj, self.user_ns))
- File "<ipython-input-187-5497fdd3fed2>", line 4, in async-def-wrapper
- File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
- last_expr = (await self._async_exec(code_obj, self.user_ns))
- File "<ipython-input-185-5497fdd3fed2>", line 4, in async-def-wrapper
- File "/Users/a567847/OneDrive - Fidelity Technology Group, LLC/Automation/Git/ap129976-auditportal/Active_directory_async.py", line 249, in get_group_details_2
- compiled_search_filter = "(&(objectClass=group)(samaccountname=%s))" % name
- File "/usr/local/lib/python3.7/site-packages/ldap3/core/connection.py", line 788, in search
- response = self.post_send_search(self.send('searchRequest', request, controls))
- File "/usr/local/lib/python3.7/site-packages/ldap3/strategy/base.py", line 299, in send
- self.sending(ldap_message)
- File "/usr/local/lib/python3.7/site-packages/ldap3/strategy/base.py", line 834, in sending
- raise communication_exception_factory(LDAPSocketSendError, type(e)(str(e)))(self.connection.last_error)
- ldap3.core.exceptions.LDAPSocketSendError: socket sending error[Errno 32] Broken pipe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement