modifying object properties

Welcome Forums General PowerShell Q&A modifying object properties

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
4 years, 4 months ago.

  • Author
    Posts
  • #17494

    Participant
    Points: 0
    Rank: Member

    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

    Member
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    Which property are you trying to modify?

    the ip address and the name

  • #17504

    Participant
    Points: 85
    Rank: Member

The topic ‘modifying object properties’ is closed to new replies.

One thought on “modifying object properties

  1. Pingback: Powershell script to change printer IP address | Sam's Corner

Comments are closed.