Navigation

    Inedo Community Forums

    Forums

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. rhessinger
    3. Posts
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by rhessinger

    • RE: $PSCredential- round two

      Hi @Jonathan-Engstrom

      I'm sorry, I should have clarified. I have a local install of Otter and I put that PowerShell inside a PSEnsure operation in my configuration for my server. It ran without issue for me, outside of the small tweaks I had to make to the syntax that I noted earlier. Would you be able to post your Otter Script operation for the PSEnsure block? Also, when you are testing the PowerShell directly, are you testing it using the same account that the otter service (or agent) is running as?

      Thanks,
      Rich

      posted in Support
      rhessinger
      rhessinger
    • RE: HOWTO Get the list of files in Artifact ?

      Hi @PhilippeC

      You could create a PowerShell script in BuildMaster and call that from your Otter Script Plan. Here is an example:

      PowerShell Script

      param ([string] $Path, [ref] $ArtifactFiles)
      
      $files = @()
      foreach($name in (get-childitem $Path | where {$_.extension -eq ".zip"}).Name) {
          $files += $name
      }
      $ArtifactFiles = $files
      

      Otter Script Plan:

      Deploy-Artifact Files
      (
          To: target
      );
      
      PSCall AppName::GetZipFiles
      (
          Path: target,
          ArtifactFils => @files
      );
      
      foreach $file in @files
      {
          # Do something with $file
      }
      

      Hope this helps!

      Thanks,
      Rich

      posted in Support
      rhessinger
      rhessinger
    • RE: $PSCredential- round two

      Hi @Jonathan-Engstrom,

      I entered your PowerShell locally on my computer this way

      $newOU =  [adsi]"LDAP://$TargetOU"
      $comp= ([adsisearcher]"samaccountname=$($ServerName)$").FindOne()
      $comp.GetDirectoryEntry().MoveTo($newOU)
      

      And that seems to work for me. The main thing I did have to change was adding in parentheses after FindOne and GetDirectoryEntry and I had to change $test to $comp. Is it possible that your PowerShell has the same issues?

      Thanks,
      Rich

      posted in Support
      rhessinger
      rhessinger
    • RE: $PSCredential- round two

      Hi @Jonathan-Engstrom,

      Can you try switching up your PowerShell a bit to this:

      $samAccountName = $ServerName
      $newOU =  [adsi]"LDAP://$TargetOU"
      $test = ([adsisearcher]"samaccountname=$($samAccountName)$").FindOne()
      $comp.GetDirectoryEntry.MoveTo($newOU)
      

      Thanks,
      Rich

      posted in Support
      rhessinger
      rhessinger
    • RE: $PSCredential- round two

      Hi @Jonathan-Engstrom ,

      Sorry for the delay. I'm working on recreating the error locally. I'll follow up with you once I have more information.

      Thanks,
      Rich

      posted in Support
      rhessinger
      rhessinger
    • RE: $PSCredential- round two

      Hi @Jonathan-Engstrom,

      In the log I see:

      @Jonathan-Engstrom said in $PSCredential- round two:

      Exception calling "FindAll" with "0" argument(s): "An operations error occurred.
      "
      You cannot call a method on a null-valued expression.

      Can you please include the OtterScript PowerShell command you are calling? Also, do you see any errors in the Diagnostic Center found at http://{YOUR_OTTER_SERVER}/administration?

      Thanks,
      Rich

      posted in Support
      rhessinger
      rhessinger
    • RE: $PSCredential- round two

      Hi @Jonathan-Engstrom,

      Could you please reply with the log output from the failed PowerShell operation?

      Thanks,
      Rich

      posted in Support
      rhessinger
      rhessinger
    • RE: $PSCredential- round two

      Hi @Jonathan-Engstrom,

      You will need to create a Resource Credential named MyCredential and then you can use that within your psensure PowerShell like this:

      Move-ADObject -Identity (Get-ADComputer -Identity $env:COMPUTERNAME).ObjectGuid -Server $pdc -TargetPath $TargetOU -Credential $PSCredential(MyCredential)
      

      By using a Resource Credential in Otter, the username and password will be securely stored in the Otter database. Please let me know if this does not work for you.

      Thanks,
      Rich

      posted in Support
      rhessinger
      rhessinger
    • RE: $PSCredential- round two

      Hi @Jonathan-Engstrom ,

      I'm sorry about this, but it looks like our documentation was out of date. We just updated our documentation and this should help to answer your question. $PSCredential now can be called in two different ways; with a username and password or by passing the resource credential name.

      In order to use a resource credential within your PowerShell, you would just need to pass your resource credential name. For example:

      # convert a resource credential named MyCredential to a PSCredential object
      PSCall MyPowerShellScript
      (
          Credentials: $PSCredential(MyCredential)
      );
      

      Please let me know if this doesn't work for you.

      Thanks,
      Rich

      posted in Support
      rhessinger
      rhessinger
    • RE: How do deployments get recorded for a ProGet package?

      Hi @mhull_0872,

      We just released the latest version of ProGet 5.2.26 on 2/28/2020 which includes the new Package Deployment API. You can learn more about the package deployment tracking feature here. We also have documentation on how to use the API endpoint here.

      Thanks,
      Rich

      posted in Support
      rhessinger
      rhessinger
    • 1
    • 2
    • 11
    • 12
    • 13
    • 14
    • 15
    • 15 / 15