Update value of CMIInstance ApplicationPoolIdentity Password value

Welcome Forums General PowerShell Q&A Update value of CMIInstance ApplicationPoolIdentity Password value

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

 
Participant
5 years, 6 months ago.

  • Author
    Posts
  • #7603

    Participant
    Points: 0
    Rank: Member

    I am able to get to a Username value of the Application pool identity via below script

    $tmp = Get-CimInstance -Namespace root/MicrosoftIISv2 -computer $servername -ClassName IIsApplicationPoolSetting -Property Name, WAMUserName, WAMUserPass | select Name, WAMUserName, WAMUserPass

    write-host "AdminACLBin:" $tmp[2].WAMUserName

     

    I want to update the WAMUserName to something else. What should be the script for this? put() doesn't seem to work for CIMInstance. Please help..

  • #7607

    Participant
    Points: 1
    Rank: Member

    Check out Get-Help Set-CimInstance. Get-CimInstance doesn't have the methods to modify the object that Get-WmiObject provides.

     

  • #7861

    Participant
    Points: 0
    Rank: Member

    The objects returned by CimInstance are inert – no methods. This is by design. When accessing remote machines you are connecting over WSMAN are in the same position as remoting. You need to use Set-CimInstance to set a property or Invoke-CimMethod to use the WMI class method.

The topic ‘Update value of CMIInstance ApplicationPoolIdentity Password value’ is closed to new replies.