Hello OSD and welcome to the board.

Well not sure how much can really be done from a script level but perhaps you can start here and see how far you can go.

Windows Management Instrumentation - CIM_Controller