The United Nations records Morocco's date of admission as 12 November 1956
Background
The United Nations member states list gives Morocco a date of admission of 12 November 1956. That places its entry in the same year that it emerged from the French and Spanish protectorates. Morocco is therefore a founding-era rather than a founding member, the organisation having been established in 1945. Membership of the United Nations is the baseline fact behind every later question about Morocco and the Security Council, the General Assembly and the specialised agencies. The World Bank, a United Nations family institution, separately puts Morocco's population at about 37.8 million. Morocco is also a member of the African Union, which it rejoined on 31 January 2017.
In plain words
Protectorate Protectorate — A territory whose foreign affairs and defence are controlled by another state while it keeps nominal rulers.