推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
KevinBu
V2EX  ›  Python

如何获取 AD 域中所有的 OU?

  •  
  •   KevinBu · Dec 18, 2018 · 3217 views
    This topic created in 2708 days ago, the information mentioned may be changed or developed.

    最近需要将组织架构和 AD 域中的 OU 绑定起来,但是只会用 Python-ldap 连接 AD 域

    请教大神这该如何做到?

    5 replies    2018-12-19 11:01:59 +08:00
    richzhu
        1
    richzhu  
       Dec 18, 2018 via iPhone
    Mark,即将用 AD
    haiyangcn
        2
    haiyangcn  
       Dec 18, 2018   ❤️ 1
    先获取所有 User,然后从每一个 User 的 DN 中查重。
    KevinBu
        3
    KevinBu  
    OP
       Dec 18, 2018
    @haiyangcn 谢谢,方法可行。 不过这样查询频率高了会不会加大服务器压力,该怎么解决,或者其他好的方法。
    smg
        4
    smg  
       Dec 19, 2018 via Android
    看标题,如果只是需要获取 AD 域中的所有 OU,用 PowerShell 是最快最便捷的,为啥一定要 Python?

    参考 Example1,把输出格式换成本地 csv.

    https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adorganizationalunit?view=win10-ps
    KevinBu
        5
    KevinBu  
    OP
       Dec 19, 2018
    @smg 因为我要把连接 AD 域加到 Python 项目中
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3339 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 10:43 · PVG 18:43 · LAX 03:43 · JFK 06:43
    ♥ Do have faith in what you're doing.