争夺操作主控角色

修复损坏主域控制器
本文介绍在未备份情况下,主域控制器损坏后的处理方法。包括使用额外域控制器接替工作,确保Active Directory正常运行,以及如何恢复修理好的主域控制器。

在多域控制器环境下,主域控制器由于硬件故障突然损坏,而又事先又没有做好备份,如何使额外域控制器接替它的工作,使Active Directory正常运行,并在硬件修理好之后,如何使损坏的主域控制器恢复。

处理方法:
从AD中清除主域控制器对象
在额外域控制器上通过ntdsutil.exe工具执行夺取五种FMSO操作
设置额外域控制器为GC(全局编录)
重新安装并恢复损坏主域控制器

查看五大角色的命令:netdom query fsmo

删除无用的主域控:
1.必须使用域超级管理员账户(administrator)
2.管理工具--active directory 站点和服务--找到坏的那台域控服务器--NTDS Settings里面的所有内容删除--删除服务器站点
3.打开活动目录和计算机--domain controllers--删除已坏的主域控计算机。

使用Ntdsutil争夺角色
在essBDC上使用命令行工具ntdsutil争夺RID主控。断开essDC的网络连接。模拟ess出现故障。
为使用ntdsutil命令来争夺操作主控角色,请执行下列步骤:
1.在run文本框中键入cmd然后按回车键。
2.在命令提示符下,键入ntdsutil。
3.在ntdsutil提示符下,键入roles。
4.在fsmo maintenance提示符下,键入connections。
5.在server connections提示符下,键入connect to server essBDC.ess.com。
6.在server connections提示符下,键入quit。
7.在fsmo maintenance提示符下,输入?,回车,可以看到该提示符下可用的命令。
8.在fsmo maintenance提示符下,键入下列命令之一 以争夺适当的操作主控:
seize RID master
seize PDC
seize schema master
seize infrastructure master
seize naming master

请注意:这里有两种方法分别是Seize和Transfer,如果原来的FSMO角色的拥有者处于离线状态,那么就要用Seize,如果处于联机状态,那么就要用Transfer。在这里由于主域E-copa已经离线了,所以要用“Seize”

   本文转自327051661 51CTO博客,原文链接:http://blog.51cto.com/andyboge/2070616,如需转载请自行联系原作者





import os.path import time import requests import debug_management import log_management import segment_delay from config_management import read_config_ini from fps_test import TestFrame from game_ui_check import check_game_state, move_timestep from linux_manage import SSHClientSingleton, linux_command_analyse from log_management import download_main, decoder_file, clean_log_files from rc_test_tools_mac import draw_test, draw_gcc, turn_utf8 if __name__ == '__main__': config = read_config_ini("config.ini") # 开启英雄联盟 url = f"http://{config['controlled_ip']}:{config['controlled_port']}/lol/run" try: response = requests.get(url, timeout=5) # 设置超时时间为 5 秒 print(response.text) # 如果请求成功,打印返回的内容 except requests.exceptions.Timeout: print("The request timed out, but the program continues running.") except requests.exceptions.RequestException as e: print(f"An error occurred: {e}") print("Wait Time") time.sleep(10) #检查屏幕状态 check_game_state() # # 创建 SSH 客户端实例(只有第一次会连接) ssh_client = SSHClientSingleton(hostname=config['linux_ip'], username=config['linux_username'], password=config['linux_password']) # # folder_path = r'网损场景配置' # 遍历路径下的所有文件 for root, dirs, files in os.walk(folder_path): for file in files: # 获取每个文件的完整路径 file_path = os.path.join(root, file) # 解析命令文件 setting_commands, unsetting_commands = linux_command_analyse(file_path,config['interface_name'], config['controlled_ip'], config['todesk_port']) # 执行网损命令 ssh_client.connect() for command in setting_commands: ssh_client.execute_command(command) ssh_client.close() # timestamp = int(time.time()) formatted_time = time.strftime('%m.%d_%H.%M.%S', time.localtime(timestamp)) # 移动进度条 for i in range(1,3): move_timestep() # 清理日志 requests.get(f"http://{config['master_ip']}:{config['master_port']}/log/clear", timeout=5) requests.get(f"http://{config['controlled_ip']}:{config['controlled_port']}/log/clear", timeout=5) download_file_path = rf"result/{file.split('.')[0]}_{formatted_time}" #进行FPS测试 TestFrame(logger=debug_management.Debug_log().logger,config=config,save_path = download_file_path).main() # 获取日志 urls = { "主控": f"http://{config['master_ip']}:{config['master_port']}/log/remote", "被": f"http://{config['controlled_ip']}:{config['controlled_port']}/log/remote" } log_paths = download_main(urls,download_file_path,formatted_time) for log_path in log_paths: if "主控" in log_path : zk_log = decoder_file(os.path.dirname(log_path), True, "zk") else: bk_log = decoder_file(os.path.dirname(log_path), True, "bk") # clean_log_files(os.path.dirname(log_path)) turn_utf8.run(os.path.dirname(log_path)) # decoder_file(r"E:\新建文件夹\主控_12.25_17.27.00", True, "zk") # decoder_file(r"E:\新建文件夹\被_12.25_17.27.00", True, "bk") # # 如果失败,手动修改log格式为 utf-8 另存为保存; # turn_utf8.run("E:\新建文件夹\被_12.25_17.27.00") # turn_utf8.run("E:\新建文件夹\主控_12.25_17.27.00") # draw_test.process( "client.logout", r"E:\新建文件夹\主控_12.25_17.27.00", r"E:\新建文件夹\被_12.25_17.27.00") # 处理统计带宽、码率、rtt,loss等 # draw_gcc.process("client.logout", r"E:\新建文件夹\主控_12.25_17.27.00", r"E:\新建文件夹\被_12.25_17.27.00") for log_path in log_paths: if "主控" in log_path : segment_delay.segment_delay(os.path.dirname(log_path),"zk") draw_test.process( "client.logout", os.path.dirname(log_paths[0]), os.path.dirname(log_paths[1])) # 处理统计带宽、码率、rtt,loss等 draw_gcc.process("client.logout", os.path.dirname(log_paths[0]), os.path.dirname(log_paths[1])) log_management.append_lines_from_second_last_to_fifth_last(os.path.join(zk_log,"segment_delay_result.txt"),os.path.join(download_file_path,"Results.txt")) print(f"{file} 场景测试完成") # 初始化网络连接状态 ssh_client.connect() for command in unsetting_commands: ssh_client.execute_command(command) ssh_client.close() log_management.txt_to_csv(download_file_path + r"\Results.txt", download_file_path + r"\Results.csv") # 关闭英雄联盟 url = f"http://{config['controlled_ip']}:{config['controlled_port']}/lol/kill" response = requests.get(url) print(response.text) 我怎么没看到这个怎么做到对两个电脑进行操作的,我想再加一个主控
08-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值