How can I use a different default admin menu icon for custom post type?

add_action( 'admin_head', 'custom_post_type_icon' );

function custom_post_type_icon() {
    ?>
    <style type="text/css" media="screen">
    #menu-posts-intranet-pages .wp-menu-image {
        background: url("PATH TO SMALL ICON") no-repeat 6px 6px !important;
    }

    #menu-posts-intranet-pages:hover .wp-menu-image, #menu-posts-intranet-pages.wp-has-current-submenu .wp-menu-image {
        background-position:6px -16px !important;
    }

    #icon-edit.icon32-posts-intranet-pages {background: url("PATH TO BIG ICON") no-repeat;}
    </style>
    <?php
}

This way is much better I believe as it also allows to add hover effect and change big icon as well. Add this piece of code and it should work. Just don’t forget to change icon url path.