modifying object properties

This topic contains 3 replies, has 3 voices, and was last updated by  Sam Boutros 3 years, 11 months ago.

  • Author
  • #17494

    Garegin Asatryan

    I have a weird question. Can you modify object properties. the command

    Get-PrinterPort 192.* | fl *

    prints out all the attributes of the printer port. but I can't modify them. I don't want to create a new port and start from scratch, just modify the existing object. Or maybe export the export and then import it, modified, into the new one.

  • #17496

    Dave Wyatt

    Well, normally you can, but this appears to be an exception to the rule. Get-PrinterPort returns a CIM object of type MSFT_PrinterPort (or one of a number of subtypes). I've tried several methods of modifying these ports through WMI (including through the older Win32_TCPIPPrinterPort class), and none of them seem to work. What's odd is that you can modify the properties of printer ports through the GUI (which means it's possible via the Win32 API, most likely). Not sure why they chose to leave that functionality out of the WMI classes.

    Which property are you trying to modify?

  • #17497

    Garegin Asatryan

    [blockquote]Which property are you trying to modify?[/blockquote]

    the ip address and the name

  • #17504

    Sam Boutros

    try this script [url][/url]

You must be logged in to reply to this topic.