%PDF- %PDF-
Direktori : /lib/python3/dist-packages/samba/netcmd/domain/__pycache__/ |
Current File : //lib/python3/dist-packages/samba/netcmd/domain/__pycache__/demote.cpython-312.pyc |
� �I�d; � � � d dl Z d dlmZ d dlmZmZmZ d dlm Z d dl mZmZ d dl mZ d dlmZmZmZmZmZmZ d dlmZ d dlmZmZmZ d d lmZ G d � de� Zy)� N)�dsdb� remove_dc�werror)�system_session)�drsuapi�misc)�drsuapi_connect)�#DS_NTDSDSA_OPT_DISABLE_INBOUND_REPL�$DS_NTDSDSA_OPT_DISABLE_OUTBOUND_REPL�UF_PARTIAL_SECRETS_ACCOUNT�UF_SERVER_TRUST_ACCOUNT�UF_TRUSTED_FOR_DELEGATION�UF_WORKSTATION_TRUST_ACCOUNT)�Net)�Command�CommandError�Option)�SamDBc �� � e Zd ZdZdZ edde�� eddded d �� edd e�� edddd�� edddd�� gZej ej ej d�Z dd�Z y)�cmd_domain_demotez4Demote ourselves from the role of Domain Controller.z%prog [options]z--serverz(writable DC to write demotion changes on)�help�typez-Hz--URLz%LDB URL for database or target server�URL�H)r r �metavar�destz--remove-other-dead-serverzMDead DC (name or NTDS GUID) to remove ALL references to (rather than this DC)z-qz--quietzBe quiet� store_true)r �actionz-vz --verbosez Be verbose)� sambaopts�credopts�versionoptsNc � � |j � } |j | � } | j ||�� }|�M|�t d|z t � | | �� }nt |t � | | �� } t j |||� y | j d� }t |t � | | �� }|s�|j dddg� � }t |� d k( rt d� �t |� dk( rt d � �d }|D ]6 }t |d � j � |j � k7 s�1|d } n |j � }|j t |j � � t j d|z dg�� }t |� d k( sd|d vrt d|z � �|d j"