How do I AddComponent NetworkIdentity to a game object

I have a game with both singleplayer and multiplayer and need to add NetworkIdentity to the GameObjects when playing multiplayer. For some reason I am failing to do this. Could someone please show me how to do this?

I solved it by saving that this is a UNET game with playerPrefs. Then i read that in each GameObject at start and if a UNET i added NetworkIdentity with addcomponent.