def get_assigned_intrusion_prevention_rules(api, configuration, api_version, api_exception):
    """ Retrieves the intrusion prevention rules that are applied to all computers.

    :param api: The Deep Security API modules.
    :param configuration: Configuration object to pass to the api client.
    :param api_version: The version of the API to use.
    :param api_exception: The Deep Security API exception module.
    :return: A dictionary of objects that contain the computer host name and their assigned rules or None if no rules.
    """

    # Include Intrusion Prevention information in the returned Computer objects
    expand = api.Expand(api.Expand.intrusion_prevention)

    try:
        # Retrieve computers from Deep Security Manager
        computers_api = api.ComputersApi(api.ApiClient(configuration))
        computers_list = computers_api.list_computers(api_version, expand=expand.list(), overrides=False)

        # Extract intrusion prevention rules from the computers
        im_rules = {}
        for computer in computers_list.computers:
            im_rules[computer.host_name] = computer.intrusion_prevention.rule_ids
        return im_rules

    except api_exception as e:
        return "Exception: " + str(e)