python-win-ad 0.6.2__py3-none-any.whl → 0.6.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyad/__init__.py +4 -0
- pyad/adbase.py +6 -3
- pyad/adobject.py +4 -2
- {python_win_ad-0.6.2.dist-info → python_win_ad-0.6.3.dist-info}/METADATA +82 -83
- {python_win_ad-0.6.2.dist-info → python_win_ad-0.6.3.dist-info}/RECORD +8 -8
- {python_win_ad-0.6.2.dist-info → python_win_ad-0.6.3.dist-info}/WHEEL +1 -1
- {python_win_ad-0.6.2.dist-info → python_win_ad-0.6.3.dist-info}/LICENSE +0 -0
- {python_win_ad-0.6.2.dist-info → python_win_ad-0.6.3.dist-info}/top_level.txt +0 -0
pyad/__init__.py
CHANGED
pyad/adbase.py
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
import sys
|
|
2
3
|
import win32com.client
|
|
3
4
|
|
|
4
5
|
from .pyadexceptions import SetupError
|
|
5
6
|
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
6
8
|
_adsi_provider = win32com.client.Dispatch("ADsNameSpaces")
|
|
7
9
|
|
|
8
10
|
try:
|
|
9
11
|
# Discover default domain and forest information
|
|
10
12
|
__default_domain_obj = _adsi_provider.GetObject("", "LDAP://rootDSE")
|
|
11
13
|
except:
|
|
12
|
-
# If there was an error, this
|
|
13
|
-
|
|
14
|
-
"
|
|
14
|
+
# If there was an error, this computer might not be on a domain.
|
|
15
|
+
logger.info(
|
|
16
|
+
"Unable to connect to default domain. "
|
|
17
|
+
"Computer is likely not attached to an AD domain."
|
|
15
18
|
)
|
|
16
19
|
__default_domain_obj = None
|
|
17
20
|
_default_detected_forest = None
|
pyad/adobject.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
import win32com
|
|
2
3
|
import pywintypes
|
|
3
4
|
import time
|
|
@@ -16,6 +17,7 @@ from .pyadconstants import (
|
|
|
16
17
|
ADS_USER_FLAG,
|
|
17
18
|
)
|
|
18
19
|
|
|
20
|
+
logger = logging.getLogger(__name__)
|
|
19
21
|
|
|
20
22
|
@total_ordering
|
|
21
23
|
class ADObject(ADBase):
|
|
@@ -664,7 +666,7 @@ class ADObject(ADBase):
|
|
|
664
666
|
)
|
|
665
667
|
node.appendChild(text)
|
|
666
668
|
except:
|
|
667
|
-
|
|
669
|
+
logger.error("attribute: %s not xml-able" % attribute)
|
|
668
670
|
else:
|
|
669
671
|
node.setAttribute("type", "multiValued")
|
|
670
672
|
ok_elem = False
|
|
@@ -684,7 +686,7 @@ class ADObject(ADBase):
|
|
|
684
686
|
node.appendChild(valnode)
|
|
685
687
|
ok_elem = True
|
|
686
688
|
except:
|
|
687
|
-
|
|
689
|
+
logger.error("attribute: %s not xml-able" % attribute)
|
|
688
690
|
if ok_elem:
|
|
689
691
|
adobj_xml_doc.appendChild(node)
|
|
690
692
|
return doc.toxml(encoding="UTF-8")
|
|
@@ -1,83 +1,82 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: python-win-ad
|
|
3
|
-
Version: 0.6.
|
|
4
|
-
Summary: An Object-Oriented Active Directory management framework built on ADSI
|
|
5
|
-
Home-page: https://github.com/jcarswell/pyad/
|
|
6
|
-
Author: Zakir Durumeric
|
|
7
|
-
Author-email: zakird@gmail.com
|
|
8
|
-
Maintainer: Josh Carswell
|
|
9
|
-
Maintainer-email: Josh.Carswell@thecarswells.ca
|
|
10
|
-
License: Apache License, Version 2.0
|
|
11
|
-
Project-URL: Documentation, https://jcarswell.github.io/pyad/
|
|
12
|
-
Project-URL: Issues, https://github.com/jcarswell/pyad/issues/
|
|
13
|
-
Keywords: python microsoft windows active directory AD adsi
|
|
14
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
-
Classifier: Intended Audience :: System Administrators
|
|
16
|
-
Classifier: Natural Language :: English
|
|
17
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
-
Classifier: Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP
|
|
19
|
-
Classifier: Programming Language :: Python :: 3
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
:
|
|
33
|
-
:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
to
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
To
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
and limitations under the License.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: python-win-ad
|
|
3
|
+
Version: 0.6.3
|
|
4
|
+
Summary: An Object-Oriented Active Directory management framework built on ADSI
|
|
5
|
+
Home-page: https://github.com/jcarswell/pyad/
|
|
6
|
+
Author: Zakir Durumeric
|
|
7
|
+
Author-email: zakird@gmail.com
|
|
8
|
+
Maintainer: Josh Carswell
|
|
9
|
+
Maintainer-email: Josh.Carswell@thecarswells.ca
|
|
10
|
+
License: Apache License, Version 2.0
|
|
11
|
+
Project-URL: Documentation, https://jcarswell.github.io/pyad/
|
|
12
|
+
Project-URL: Issues, https://github.com/jcarswell/pyad/issues/
|
|
13
|
+
Keywords: python microsoft windows active directory AD adsi
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Obsoletes: pyad
|
|
25
|
+
Requires-Python: >=3.6
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: setuptools
|
|
28
|
+
Requires-Dist: pywin32
|
|
29
|
+
|
|
30
|
+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
|
31
|
+
:align: center
|
|
32
|
+
:target: https://github.com/psf/black
|
|
33
|
+
:alt: code style: black
|
|
34
|
+
|
|
35
|
+
Introduction
|
|
36
|
+
------------
|
|
37
|
+
|
|
38
|
+
pyad is a Python library designed to provide a simple, Pythonic interface to Active Directory
|
|
39
|
+
through ADSI on the Windows platform. Complete documentation can be found at
|
|
40
|
+
http://jcarswell.github.io/pyad/. Code is maintained at https://github.com/jcarswell/pyad. The
|
|
41
|
+
library can be downloaded from PyPI at https://github.com/jcarswell/pyad.
|
|
42
|
+
|
|
43
|
+
Breaking Changes from upstream
|
|
44
|
+
------------------------------
|
|
45
|
+
|
|
46
|
+
ADObject:
|
|
47
|
+
|
|
48
|
+
- _get_password_last_set - Act's like AD and returns 1970-01-01 if the date can't be parsed
|
|
49
|
+
- get_last_login - Act's like AD and returns 1970-01-01 if the date can't be parsed
|
|
50
|
+
|
|
51
|
+
Importing pyad directly exposes set_defaults, ADQuery, ADComputer, ADContainer, ADDomain,
|
|
52
|
+
ADGroup, ADUser, from_cn, from_dn, from_guid. Importing pyad.pyad no longer imports
|
|
53
|
+
the sub modules
|
|
54
|
+
|
|
55
|
+
Most ADObject update methods now take flush as an optional argument that defaults to True
|
|
56
|
+
to maintain compatibility with upstream code. For large updates it's recommended to set
|
|
57
|
+
this to False until you are ready to write out the change, otherwise you may run into a
|
|
58
|
+
back-off period in AD where all further changes will fail.
|
|
59
|
+
|
|
60
|
+
Requirements
|
|
61
|
+
------------
|
|
62
|
+
|
|
63
|
+
pyad requires pywin32, available at https://github.com/mhammond/pywin32.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
Testing
|
|
67
|
+
-------
|
|
68
|
+
|
|
69
|
+
To run unittest you will need to set the configuration to be specific to your environment.
|
|
70
|
+
To do this you will need to edit config.py located in the tests folder.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
License
|
|
74
|
+
-------
|
|
75
|
+
|
|
76
|
+
pyad is licensed under the Apache License, Version 2.0 (the "License"). You may obtain a copy
|
|
77
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
78
|
+
|
|
79
|
+
Unless required by applicable law or agreed to in writing, software distributed under the
|
|
80
|
+
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
81
|
+
either express or implied. See the License for the specific language governing permissions
|
|
82
|
+
and limitations under the License.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
pyad/__init__.py,sha256=
|
|
2
|
-
pyad/adbase.py,sha256=
|
|
1
|
+
pyad/__init__.py,sha256=RlMEJyo2g6VwxlOhDJzfPfrUGw90SVFZThTN7Gmf5Nk,1771
|
|
2
|
+
pyad/adbase.py,sha256=hghiIpcQjJs0X9laqwbkShjlW21jiKIHJGBw3CDAMN4,3016
|
|
3
3
|
pyad/adcomputer.py,sha256=Wnsx-aD0ugOsgUyHx__6GWd2ogk3aiv4ARqhI_AoPZk,1109
|
|
4
4
|
pyad/adcontainer.py,sha256=dod_T6o7k-2cUmSVragtJnQrlaNwe7Mx5sNCexxbrjQ,8817
|
|
5
5
|
pyad/addomain.py,sha256=ppCUyONuNJAFVPxxCl4Z2o1-Lp0XesS3Wo1ao0YEoDg,850
|
|
6
6
|
pyad/adgroup.py,sha256=nevw3ZBAw58o_qYoXn7dN1bnOvIuwfsZMbZH6cF_dlM,11377
|
|
7
|
-
pyad/adobject.py,sha256=
|
|
7
|
+
pyad/adobject.py,sha256=7_497WoGXjdvVGfm5SuszFXEH5rK4R6E7WFFdVM8Rc8,30791
|
|
8
8
|
pyad/adquery.py,sha256=tv0dKkBgcSnhU7Garv6jAEGiUJkwC256I3o2jUpCS7M,10820
|
|
9
9
|
pyad/adsearch.py,sha256=a24vVolTRINQpmuQ3Ldq_2hlHXl9r700vjilINqXk8M,2702
|
|
10
10
|
pyad/aduser.py,sha256=DK0ADC0qXLUodTW0cphvgg8-0iSewaoYw5rSTtje6Dg,3936
|
|
@@ -12,8 +12,8 @@ pyad/pyad.py,sha256=moPUvolc0vI-JIIIjW8otUclgkUov0fT1pym1vufdNs,1091
|
|
|
12
12
|
pyad/pyadconstants.py,sha256=wny29f6aAYhRosWp-lXp_2Rn8HCn3J0BI_G1XFMg5DA,6739
|
|
13
13
|
pyad/pyadexceptions.py,sha256=R8q5dSsqOgULpqVYoz2yvNi6lENZ9wg0PZQnp2Y1sWg,2149
|
|
14
14
|
pyad/pyadutils.py,sha256=0c3wTZEUCv3WE59SO3bzJYfhaO10HsCbQS1D3lo9X10,10486
|
|
15
|
-
python_win_ad-0.6.
|
|
16
|
-
python_win_ad-0.6.
|
|
17
|
-
python_win_ad-0.6.
|
|
18
|
-
python_win_ad-0.6.
|
|
19
|
-
python_win_ad-0.6.
|
|
15
|
+
python_win_ad-0.6.3.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
16
|
+
python_win_ad-0.6.3.dist-info/METADATA,sha256=Hv4j9QaJBQdPgxPcdNcRv6zYqYfCk2jDQxDt6nATpXo,3346
|
|
17
|
+
python_win_ad-0.6.3.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
18
|
+
python_win_ad-0.6.3.dist-info/top_level.txt,sha256=nRuluAlQ0ORm6J1nBi_n7OlMbbqTp7JDtl3g14wpSmI,5
|
|
19
|
+
python_win_ad-0.6.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|