The command would be vtp pruning under global configuration.
This will stop the advertisement of unused VLANs to other switches.
For this tutorial we assume that you have following topology running in packet tracer.
You can create this topology by following the instruction given in second part of this article or alternatively download the pre created topology from there. In this part we explained basic concepts of VLAN such as What VLAN is, Advantage of VLAN, VLAN membership Static and Dynamic, VLAN Connections; Access link and trunk links, trunk tagging and how VLAN add additional layer of security with examples. In this part we setup a practice lab in Packet Tracer.
The documentation clearly states that in VTP version 2 a switch in transparent mode will not inspect the domain name, but we can see from this test that it does appear to inspect the domain name and does not pass along messages that do not match its configured domain name. I will configure the same domain name on SW2, but leave it in transparent mode. Before you start configuring something in production or on a lab exam, be sure you know how it really works.
This tutorial explains basic concepts of VTP Protocol, VTP Domain, VTP Messages and VTP modes (Server mode, Transparent mode and Client mode) in detail with practical example in packet tracer.
Cisco created this protocol to share and synchronize their VLAN information throughout the network.