univention.management.console.modules.adtakeover package

Contents

univention.management.console.modules.adtakeover package#

univention.management.console.modules.adtakeover.reset_progress(func)[source]#
class univention.management.console.modules.adtakeover.Instance(*args, **kwargs)[source]#

Bases: Base

init()[source]#

this function is invoked after the module process started.

poll(request, *args, **kwargs)[source]#
check_status(request, *args, **kwargs)[source]#
set_status_done(request, *args, **kwargs)[source]#
connect(request, *args, **kwargs)[source]#
copy_domain_data(request, *args, **kwargs)[source]#
sysvol_info(request, *args, **kwargs)[source]#
check_sysvol(request, *args, **kwargs)[source]#
take_over_domain(request, *args, **kwargs)[source]#

Submodules#

univention.management.console.modules.adtakeover.takeover module#

class univention.management.console.modules.adtakeover.takeover.Progress[source]#

Bases: object

Progress information. reset() and error() are set by the UMC module. progress.warning can be used when something went wrong which is not raise-worthy

reset()[source]#
set(headline=None, message=None, percentage=None)[source]#
headline(headline)[source]#
message(message)[source]#
percentage(percentage)[source]#
percentage_increment_scaled(fraction)[source]#
warning(error)[source]#
error(error)[source]#
finish()[source]#
poll()[source]#
exception univention.management.console.modules.adtakeover.takeover.TakeoverError(errormessage=None, detail=None)[source]#

Bases: Exception

AD Takeover Error

exception univention.management.console.modules.adtakeover.takeover.ComputerUnreachable(errormessage=None, detail=None)[source]#

Bases: TakeoverError

default_error_message = 'The computer is not reachable.'#
exception univention.management.console.modules.adtakeover.takeover.AuthenticationFailed(errormessage=None, detail=None)[source]#

Bases: TakeoverError

default_error_message = 'Authentication failed.'#
exception univention.management.console.modules.adtakeover.takeover.DomainJoinFailed(errormessage=None, detail=None)[source]#

Bases: TakeoverError

default_error_message = 'Domain join failed.'#
exception univention.management.console.modules.adtakeover.takeover.SysvolGPOMissing(errormessage=None, detail=None)[source]#

Bases: TakeoverError

default_error_message = 'At least one GPO is still missing in SYSVOL.'#
exception univention.management.console.modules.adtakeover.takeover.SysvolGPOVersionTooLow(errormessage=None, detail=None)[source]#

Bases: TakeoverError

default_error_message = 'At least one GPO in SYSVOL is not up to date yet.'#
exception univention.management.console.modules.adtakeover.takeover.SysvolGPOVersionMismatch(errormessage=None, detail=None)[source]#

Bases: TakeoverError

default_error_message = 'At least one GPO in SYSVOL is newer than the Group Policy Container version.'#
exception univention.management.console.modules.adtakeover.takeover.SysvolError(errormessage=None, detail=None)[source]#

Bases: TakeoverError

default_error_message = 'Something is wrong with the SYSVOL.'#
exception univention.management.console.modules.adtakeover.takeover.ADServerRunning(errormessage=None, detail=None)[source]#

Bases: TakeoverError

default_error_message = 'The Active Directory server seems to be running. It must be shut off.'#
exception univention.management.console.modules.adtakeover.takeover.TimeSynchronizationFailed(errormessage=None, detail=None)[source]#

Bases: TakeoverError

default_error_message = 'Time synchronization failed.'#
exception univention.management.console.modules.adtakeover.takeover.ManualTimeSynchronizationRequired(errormessage=None, detail=None)[source]#

Bases: TimeSynchronizationFailed

default_error_message = 'Time difference critical for Kerberos but synchronization aborted.'#
exception univention.management.console.modules.adtakeover.takeover.LicenseInsufficient(errormessage=None, detail=None)[source]#

Bases: TakeoverError

default_error_message = 'Insufficient License.'#
univention.management.console.modules.adtakeover.takeover.count_domain_objects_on_server(hostname_or_ip: str, username: str, password: str, progress: Progress) dict[source]#

Connects to the hostname_or_ip with username/password credentials.

Expects to find a Windows Domain Controller.

Example return value:

{
    'ad_hostname' : hostname,
    'ad_ip' : hostname_or_ip,
    'ad_os' : version_of_the_ad, # "Windows 2008 R2"
    'ad_domain' : domain_of_the_ad, # "mydomain.example"
    'users' : number_of_users_in_domain,
    'groups' : number_of_groups_in_domain,
    'computers' : number_of_computers_in_domain,
    'license_error' : error_message_from_validating_license,
}
Returns:

dict like above

Raises:
univention.management.console.modules.adtakeover.takeover.join_to_domain_and_copy_domain_data(hostname_or_ip, username, password, progress)[source]#

Connects to the hostname_or_ip with username/password credentials Expects to find a Windows Domain Controller. Gets str, str, str, Progress Raises ComputerUnreachable, AuthenticationFailed, DomainJoinFailed

univention.management.console.modules.adtakeover.takeover.take_over_domain(progress)[source]#

Actually takes control of the domain, deletes old AD server, takes its IP, etc. Gets Progress Raises AuthenticationFailed, DomainJoinFailed, ADServerRunning

univention.management.console.modules.adtakeover.takeover.check_status()[source]#

Where are we in the process of AD takeover? Returns one of: ‘start’ -> nothing happened yet ‘sysvol’ -> we copied domain data, sysvol was not yet copied’ ‘takeover’ -> sysvol was copied. we can now take over the domain ‘finished’ -> already finished

univention.management.console.modules.adtakeover.takeover.check_sysvol(progress)[source]#

Whether the AD sysvol is already copied to the local system Gets Progress Raises SysvolError

univention.management.console.modules.adtakeover.takeover.set_status_done()[source]#

Set status to “done”, indicating the module has been run once successfully and may be started again.

class univention.management.console.modules.adtakeover.takeover.AD_Takeover_State[source]#

Bases: object

check_sysvol()[source]#
check_takeover()[source]#
check_start()[source]#
set_start()[source]#
set_joined()[source]#
set_sysvol()[source]#
set_takeover()[source]#
set_finished()[source]#
set_done()[source]#
current()[source]#
univention.management.console.modules.adtakeover.takeover.get_ip_and_hostname_of_ad()[source]#
univention.management.console.modules.adtakeover.takeover.get_ad_hostname()[source]#

The hostname of the AD to be specified in robocopy

univention.management.console.modules.adtakeover.takeover.sysvol_info()[source]#

The info needed for the “Copy SYSVOL”-page, i.e. “ad_hostname” and “ucs_hostname”

class univention.management.console.modules.adtakeover.takeover.UCS_License_detection(ucr)[source]#

Bases: object

determine_license(lo, dn)[source]#
check_license(domain_info)[source]#
class univention.management.console.modules.adtakeover.takeover.AD_Connection(hostname_or_ip, lp=None)[source]#

Bases: object

authenticate(username, password, lp=None)[source]#
reconnect()[source]#
operatingSystem(netbios_name)[source]#
count_objects(ignored_users_list)[source]#
class univention.management.console.modules.adtakeover.takeover.AD_Takeover(ucr, ad_connection)[source]#

Bases: object

time_sync(tolerance=180, critical_difference=360)[source]#

Try to sync the local time with an AD server

disable_admember_mode(progress)[source]#
join_AD(progress)[source]#
cleanup_failed_join()[source]#
post_join_tasks_and_start_samba_without_drsuapi()[source]#
remove_conflicting_msgpo_objects()[source]#

The S4 Connector prefers OpenLDAP objects, so we must remove conflicting ones

rewrite_sambaSIDs_in_OpenLDAP()[source]#
resync_s4connector_listener(progress)[source]#
start_s4_connector(progress)[source]#
rebuild_idmap()[source]#
set_nameserver1_to_local_default_ip()[source]#
reset_sysvol_ntacls()[source]#
class univention.management.console.modules.adtakeover.takeover.AD_Takeover_Finalize(ucr)[source]#

Bases: object

ping_AD(progress)[source]#
post_join_fix_samDB()[source]#
fix_sysvol_acls()[source]#
create_DNS_alias_for_AD_hostname()[source]#
remove_AD_server_account_from_samdb()[source]#
remove_AD_server_account_from_UDM()[source]#
create_NETBIOS_alias_for_AD_hostname()[source]#
create_virtual_IP_alias()[source]#
create_reverse_DNS_records()[source]#
reconfigure_nameserver_for_samba_backend()[source]#
claim_FSMO_roles()[source]#
configure_SNTP()[source]#
finalize()[source]#
univention.management.console.modules.adtakeover.takeover.check_gpo_presence()[source]#
class univention.management.console.modules.adtakeover.takeover.Timer[source]#

Bases: object

start(label)[source]#
timestamp(label)[source]#
log_stats()[source]#
univention.management.console.modules.adtakeover.takeover.determine_IP_version(address)[source]#
univention.management.console.modules.adtakeover.takeover.ldap_uri_for_host(hostname_or_ip)[source]#
univention.management.console.modules.adtakeover.takeover.ping(hostname_or_ip)[source]#
univention.management.console.modules.adtakeover.takeover.lookup_adds_dc(hostname_or_ip=None, realm=None, ucr=None)[source]#

CLDAP lookup

univention.management.console.modules.adtakeover.takeover.run_and_output_to_log(cmd, log_function, print_commandline=True)[source]#
univention.management.console.modules.adtakeover.takeover.get_stable_last_id(progress=None, max_time=20)[source]#
univention.management.console.modules.adtakeover.takeover.wait_for_listener_replication(progress=None, max_time=None)[source]#
univention.management.console.modules.adtakeover.takeover.wait_for_s4_connector_replication(ucr, lp, progress=None, max_time=None)[source]#
univention.management.console.modules.adtakeover.takeover.check_samba4_started()[source]#
class univention.management.console.modules.adtakeover.takeover.UserRenameHandler(lo)[source]#

Bases: object

Provides methods for renaming users in UDM

udm_rename_ucs_user(userdn, new_name)[source]#
rename_ucs_user(ucsldap_object_name, ad_object_name)[source]#
class univention.management.console.modules.adtakeover.takeover.GroupRenameHandler(lo)[source]#

Bases: object

Provides methods for renaming groups in UDM

udm_rename_ucs_group(groupdn, new_name)[source]#
udm_rename_ucs_defaultGroup(groupdn, new_groupdn)[source]#
rename_ucs_group(ucsldap_object_name, ad_object_name)[source]#
univention.management.console.modules.adtakeover.takeover.operatingSystem_attribute(ucr, samdb)[source]#
univention.management.console.modules.adtakeover.takeover.takeover_DC_Behavior_Version(ucr, remote_samdb, samdb, ad_server_name, sitename)[source]#
univention.management.console.modules.adtakeover.takeover.takeover_hasInstantiatedNCs(ucr, samdb, ad_server_name, sitename)[source]#
univention.management.console.modules.adtakeover.takeover.takeover_hasMasterNCs(ucr, samdb, sitename, partitions)[source]#
univention.management.console.modules.adtakeover.takeover.let_samba4_manage_etc_krb5_keytab(ucr, secretsdb)[source]#
univention.management.console.modules.adtakeover.takeover.add_servicePrincipals(ucr, secretsdb, spn_list)[source]#
univention.management.console.modules.adtakeover.takeover.sync_position_s4_to_ucs(ucr, udm_type, ucs_object_dn, s4_object_dn)[source]#
univention.management.console.modules.adtakeover.takeover.parse_unc(unc)[source]#

Parse UNC string into a hostname, a service, and a filepath

univention.management.console.modules.adtakeover.takeover.run_phaseI(ucr, lp, opts, args, parser, creds, always_answer_with=None)[source]#
univention.management.console.modules.adtakeover.takeover.run_phaseIII(ucr, lp, ad_server_ip, ad_server_fqdn, ad_server_name)[source]#