We present the design and implementation of the Software-Defined IoT Management (SDIM) framework based on a Software-Defined Networking (SDN) enabled architecture that is purpose-built for edge computing multidomain Wireless Sensor Networks (WSNs). This framework can dynamically provision IoT devices to enable machine-to-machine communication as well as continuous operational fault detection for WSNs. Unlike the existing approaches in the literature, SDIM is mainly deployed at Multi-access Edge Computing (MEC) nodes and is integrated with the cloud by aggregating multidomain topology information. Backed by experimental results over the University of Bristol 5G test network, we demonstrate in practice that our framework outperforms the implementations of the LWM2M and NETCONF Light IoT device management protocols when deployed autonomously at the network edge and/or the cloud. Specifically, SDIM edge deployments can lower average device provisioning time as high as 46% compared to LWM2M and 60.3% compared to NETCONF light. Moreover, it can decrease the average operational fault detection time by approximately 33% compared to LWM2M and roughly 40% compared to NETCONF light. Also, SDIM reduces control operations time up to 27%, posing a powerful feature for use cases with time-critical control requirements. Last, SDIM manages to both reduce CPU consumption and to have important energy consumption gains at the network edge, which can reach as high as 20% during device provisioning and 4.5-4.9% during fault detection compared to the benchmark framework deployments.