Thank you for the reply,
I know how to add a new switch with the above provided commands. My requirement is ---> I want to add a new switch in place of a faulty switch in a stack without issuing any commands. the switch should automatically configure itself in place of a faulty one (new switch).
I wont be there every time to replace a faulty switch in a stack and My team is less knowledge in networking part. so i want to configure switches in a way that replacing the faulty switch with a new one should work as my original stacking without any commands( for new switch only)
kindly let me know if there is any scripting part included.