We need to deal with a group names through SID's rather than names because each group name is different in…