DX Infrastructure Manager

Expand all | Collapse all

Return list of robots from a hub (in PowerShell)

  • 1.  Return list of robots from a hub (in PowerShell)

    Posted 05-20-2009 06:43 PM

    The attached script will return a set of PowerShell objects representing robots when run on a Nimbus Hub server.



    I plan to use it so I can compare the list of computers in Nimbus with the list of computers in Active Directory to find any computers that are not currently being monitored.



    If you are using PowerShell and would like to see more support from Nimbus, please ask for it.



    Update: The script will only work from a 32-bit PowerShell session as nimbus.dll is 32-bit.




    Cheers,

    Chris



  • 2.  Return list of robots from a hub (in PowerShell)

    Posted 06-09-2009 09:22 AM
    Hi Chris,
    For some reason I cannot access the attachment. Can you try again?
    Thanks
    Remko


  • 3.  Return list of robots from a hub (in PowerShell)

    Posted 06-11-2009 04:19 PM
    Hi Remko,

    I renamed the script to *.ps1.txt.



    You should be able to download it now. If not, feel free to email me and I'll send you a copy directly.



    Chris



  • 4.  Re: Return list of robots from a hub (in PowerShell)

    Posted 09-01-2010 07:31 PM

    Hi Chris,

     

    I looked your script, it's great, but it' requires local service.

     

    Do you know how to connect to remote Domain/Hub with credential in Powershell?

     

    Thanks.

     

    Jibin



  • 5.  Re: Return list of robots from a hub (in PowerShell)

    Posted 06-08-2015 12:45 PM

    Hi Chris,

     

    I cant find the file that you attach.

     

    Where i can download the script?

     

    Thanks,

    Alex



  • 6.  Re: Return list of robots from a hub (in PowerShell)

    Posted 01-14-2016 03:20 PM

    I also am very interested in getting the script.



  • 7.  Re: Return list of robots from a hub (in PowerShell)

    Posted 01-15-2016 12:15 AM

    Here's a simple example script utilizing the .Net SDK. It requires that a robot is installed on the machine and you have nimbusapi.dll in your c:\temp or some other folder.

     

    add-type -path c:\temp\nimbusapi.dll
    
    
    function new-uimlogin {
      [CmdletBinding()]
      param (
            [parameter(Mandatory=$true,Position=0)]
            [string]$Username,
            
            [parameter(Mandatory=$true, Position=1)]
            [string]$Password
        )
        PROCESS {
      [Nimsoft.NimBUS.Messaging.NimbusSession]$s =  New-Object -TypeName Nimsoft.NimBUS.Messaging.NimbusSession
      $global:sid = $s.login($Username, $Password, $false)
      $s.Dispose()
        }
    }
    
    
    function get-uimhub {
      [CmdletBinding()]
      param (
            [parameter(Mandatory=$false,Position=0)]
            [string]$Ip = 127.0.0.1,
            
            [parameter(Mandatory=$false, Position=1)]
            [int]$Port = 48002
        )
        PROCESS {
      [Nimsoft.NimBUS.Messaging.NimbusSession]$s =  New-Object -TypeName Nimsoft.NimBUS.Messaging.NimbusSession -argumentlist $Ip, $Port, $global:sid
      [Nimsoft.NimBUS.Messaging.Request]$request = [Nimsoft.NimBUS.Messaging.Request]$req = New-Object -TypeName Nimsoft.NimBUS.Messaging.Request -ArgumentList gethubs
      $hubs = $s.SendMessage($req)
    
    
      $hubCol = @()
    
    
      foreach ($pds in $hubs.gettablepdss("hublist")) {
      $hubObj = new-object -type PSObject
      foreach ($key in $pds.getkeys()) {
      $hubObj | add-member -type noteproperty -name $key -value $pds.getvalueasstring($key)
      }
      $hubCol += $hubObj
      }
      $s.Dispose()
    
      $hubCol
        }
    }
    

     

    and here's how to use it

    ipmo <filename>.ps1
    new-uimlogin -username <user> -password <pass>
    get-hub # if on a hub machine
    get-hub -ip <ip> # if on a robot
    

     

    -jon



  • 8.  Re: Return list of robots from a hub (in PowerShell)

    Posted 05-21-2019 12:07 PM

    Exactly what I was looking for.  A great foundation for building a module.