Powershell Test-ComputerSecureChannel

Welcome Forums General PowerShell Q&A Powershell Test-ComputerSecureChannel

Viewing 1 reply thread
  • Author
    Posts
    • #241343
      Participant
      Topics: 1
      Replies: 0
      Points: 12
      Rank: Member

      I’m trying to script a secure channel check that will reconnect the pc automatically. Here is my script :

      $username = “username”
      $password = ConvertTo-SecureString “password” -AsPlainText -Force

      $Credentials = New-Object System.Management.Automation.PSCredential -argumentlist ($username,$password)

      Test-ComputerSecureChannel -repair -credential $Credentials

      The answer I get is that it cannot reinitialise the channel password for the account in the domain and that the access is denied.

      (Exception de HRESULT : 0x80070005 (E_ACCESSDENIED)).

      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : OperationStopped: (HPGE-449-BP:String) [Test-ComputerSecureChannel], InvalidOperationException
      + FullyQualifiedErrorId : FailToResetPasswordOnDomain,Microsoft.PowerShell.Commands.TestComputerSecureChannelCommand

       

      If someone has any answer to this I would be glad to have some help,

      Thank you!

    • #241922
      Senior Moderator
      Topics: 9
      Replies: 1264
      Points: 4,576
      Helping Hand
      Rank: Community Hero

      You should be using a domain account for this domain\user and the user should have access to perform this task.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.