Run ps1 on secondary domain

Welcome Forums General PowerShell Q&A Run ps1 on secondary domain

Viewing 3 reply threads
  • Author
    Posts
    • #190738
      Participant
      Topics: 17
      Replies: 22
      Points: 210
      Rank: Participant

      I need a way to run some scripts in a child domain. I launch scripts using a batch file like below.

      @echo off
      Powershell.exe -windowstyle hidden -executionpolicy bypass -File .\script.ps1

      I can shift + right click the batch file and use creds from 2nd domain but get an error "Logon failure: the user has not been granted the requested logon type at this computer"

      How can I run scripts in a secondary domain?

    • #190747
      Senior Moderator
      Topics: 8
      Replies: 1140
      Points: 3,922
      Helping Hand
      Rank: Community Hero

      I think, there is some group policy blocking you in doing this. You may try disabling all policies if feasible to verify this.

    • #190753
      Participant
      Topics: 17
      Replies: 22
      Points: 210
      Rank: Participant

      Tried that but it still ran on the parent domain not the child domain.

    • #190777
      Senior Moderator
      Topics: 8
      Replies: 1140
      Points: 3,922
      Helping Hand
      Rank: Community Hero

      Using which user are you trying to execute it on child domain ? This is of course some because of policies.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.