def encode_password(password: str):
    """ Encodes a password to be set for an AD account via the LDAP protocol.
    Surrounds password in quotes and encodes with 'utf-16-le' as is required when setting the
    password of the computer account.
    """
    quoted_pw = '"' + password + '"'
    encoded_pw = quoted_pw.encode('utf-16-le')
    return encoded_pw