Copy Instances from Microsoft.Windows.Computer to Microsoft.Windows.Client.Computer

I want to copy the instances of Microsoft.Windows.Computer to Microsoft.Windows.Client.Computer When the OS is Client OS.

Now I have all machines in Microsoft.Windows.Computer. But I want them into Microsoft.Windows.Client.Computer.

So I can extend the Microsoft.Windows.Client.Computer class with client specific properties.

December 11th, 2014 5:11pm

Anyone ?
Free Windows Admin Tool Kit Click here and download it now
January 20th, 2015 4:52pm

Microsoft.Windows.Client.Computer inherits from Microsoft.Windows.Computer. It is possible to make an existing Microsoft.Windows.Computer a Microsoft.Windows.Client.Computer. Basically, this routine adds a new entry to the Type Managed Entity for the selected object.

You must create a "new object" of the Microsoft.Windows.Client.Computer class but the key property (in this case, PrincipalName) can match the principal name of an existing Microsoft.Windows.Computer.

So, for instance, let's say you have a Microsoft.Windows.Computer class object with a PrincipalName "MyComputer.MyDomain.Net"

You can use the SDK or Powershell to "create" a Microsoft.Windows.Client.Computer class object with the same PrincipalName. This will add the Microsoft.Windows.Client.Computer class properties to that same object (including any extension properties you may have added to the client computer class).

$mpc = get-scsmclass -name Microsoft.Windows.Client.Computer
new-scsmobject -class $mpc -propertyhashtable @{"PrincipalName" = "MyComputer.MyDomain.Net";}

So..it's not exactly "copying" as such..it's more like "morphing". MyComputer.MyDomain.Net is still a Microsoft.Windows.Computer class object, but now it is also a Microsoft.Windows.Client.Computer class object

edit: in the interest of full disclosure, I only tried this technique this morning and was surprised it worked. SCSM's class system is a little less strict than I thought. There may be a more elegant way of "morphing" an object into a child class and I'm going to dig into the SDK later to see if any such morphing routines exist..but, for now, the "create new object" trick should work fine for you.


  • Edited by Aaron Croasmun Tuesday, January 20, 2015 3:30 PM
  • Marked as answer by FrankCoast Thursday, January 22, 2015 2:15 PM
January 20th, 2015 6:24pm

I worked. This made it all more clear for me ...

Thank you very much

Free Windows Admin Tool Kit Click here and download it now
January 22nd, 2015 5:15pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics