WSUS Reset SID Script V4

My coding isn't great (I'm only self taught), but basically this Script was designed when we added a WSUS Server to the network, and because we have two domains and some units shared SID's, they were all jumping around different update groups, some not even appearing til' we ran this script. This aims to stop that.