Software is expensive, more than the cost of the hardware on which it is being run. It needs to be treated as the valuable asset it is and carefully managed. In order to do this you must keep very accurate records of its purchase, from whom and where it is installed.
Purchase software assurance, this will let you legally upgrade and keep current. Some software has license management built in; it is worth investigating and using network license managers if you can.
Undertake an at least annual audit of what is installed.
Do not let staff bring in software from home or install themselves. Consider using .
Invest in (SAM) software and consultancy to monitor installed software versus licenses owned, but more importantly their appropriate use too. If you have any doubts as to legitimacy you should check with the software author or one of its partners.