How to define an intermediate admin user as the default install profile on fresh drupal 7?
You need to create a new role

$admin_role = new stdClass();
$admin_role-&gt;name = 'myadminwithoutmenuaccess';
user_role_save($admin_role);


//This will give them all perms
user_role_grant_permissions($admin_role-&gt;rid, array_keys(module_invoke_all('permission')));


Then you just revoke administration menu

 user_role_revoke_permissions($admin_role-&gt;rid, array $permissions = array('administration menu'))


if you need to get the $rid at a later time you can do 
user_role_load_by_name()