none
Looking after a script to start an inactive PU... RRS feed

  • Question

  • Hi,

    From time to time after an host IPL one PU stay inactive and I'm looking after a way to start it by script, by any way, can be vbs, wmi, powershell, etc... I know how to detect an inactive PU but how to start it ?

    thanks


    Laurent THALER

    Monday, April 29, 2013 7:38 AM

Answers

  • To close the loop on this problem, it was resolved when the service account used by the HIS services was added to the HIS Administrators group. This is normally not required as I was able to run the WMI commands on my test systems and the HIS service account was not added to the HIS Administrators group. There likely was an environmental scenario that possibly altered some other permissions that affected this particular WMI command.


    Stephen Jackson - MSFT

    Wednesday, May 15, 2013 1:59 PM

All replies

  • The HIS SDk includes some samples for WMI and Powershell (in current versions) that use the HIS WMI providers for management scenarios. The scenario youa re asking about is not explicitly called out, however the following is a sample of how to Stop and Start a DLC connection using a simple script:

    Stopping a DLC connection:

    Note: You need to change the connection name below as SNAPU001 is just an example.

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftHIS")
    ' Obtain an instance of the the class
    ' using a key property value.
    Set objShare = objWMIService.Get("MsSna_Connection8022Dlc.Name='SNAPU001'")
    ' Execute the method and obtain the return status.
    ' The OutParameters object in objOutParams
    ' is created by the provider.
    Set objOutParams = objWMIService.ExecMethod("MsSna_Connection8022Dlc.Name='SNAPU001'", "Stop")
    ' No outParams

    Starting a DLC connection:

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftHIS")
    ' Obtain an instance of the the class
    ' using a key property value.
    Set objShare = objWMIService.Get("MsSna_Connection8022Dlc.Name='SNAPU001'")
    ' Execute the method and obtain the return status.
    ' The OutParameters object in objOutParams
    ' is created by the provider.
    Set objOutParams = objWMIService.ExecMethod("MsSna_Connection8022Dlc.Name='SNAPU001'", "Start")
    ' No outParams

    If you have IP-DLC connections, the script would eb similar except you'd use MsSna_ConnectionIpDlc for the WMI class.

    Thanks...


    Stephen Jackson - MSFT

    Monday, April 29, 2013 2:42 PM
  • Thanks for your answer Stephen but unfortunately it doesn't work at all

    I obtain an access denied error message because the methods "stop" and "start" beeing not derivated to instances 

    here is an image of what one cand find with wbemtest, I tried with his2006/2k3 and his2010/2k8r2, same results

    https://skydrive.live.com/redir?resid=220E4A69864EA20!182&authkey=!AKfFabZpbtVz3gE

    (unable to insert the image in the forum but the url is ok)


    Laurent THALER


    Monday, April 29, 2013 3:23 PM
  • I just ran the following on my HIS 2010 CU6 Server and HSI 2006 SP1 Server (connections names were different, but the code was the same otherwise) to start an IP-DLC connection:

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftHIS")
    ' Obtain an instance of the the class
    ' using a key property value.
    Set objShare = objWMIService.Get("MsSna_ConnectionIpDlc.Name='SYS1HOST'")

    ' no InParameters to define

    ' Execute the method and obtain the return status.
    ' The OutParameters object in objOutParams
    ' is created by the provider.
    Set objOutParams = objWMIService.ExecMethod("MsSna_ConnectionIpDlc.Name='SYS1HOST'", "Start")

    ' No outParams

    I also went through WBEMTEST to do this successfully:

    - Click on Execute Method
    - Enter the following in Object Path: MsSna_ConnectionIpDlc.Name='SYS1HOST'
    - Click OK.
    - Choose Start from the Method drop-down list.
    - Click Execute!

    This activated the connection in my test.

    Thanks...


    Stephen Jackson - MSFT

    Monday, April 29, 2013 3:58 PM
  • Laurent,

    Is the account that the script is running under a member of the HIS Administrators group?

    It appears that this is a permissions issue.


    Stephen Jackson - MSFT

    Wednesday, May 1, 2013 4:30 PM
  • To close the loop on this problem, it was resolved when the service account used by the HIS services was added to the HIS Administrators group. This is normally not required as I was able to run the WMI commands on my test systems and the HIS service account was not added to the HIS Administrators group. There likely was an environmental scenario that possibly altered some other permissions that affected this particular WMI command.


    Stephen Jackson - MSFT

    Wednesday, May 15, 2013 1:59 PM