Here is a simple Python script that interacts with Active Directory (AD) using the pyad library: import pyad def main():…