Overriding secuirty with get-childitem

Welcome Forums General PowerShell Q&A Overriding secuirty with get-childitem

Viewing 3 reply threads
  • Author
    Posts
    • #174811
      Participant
      Topics: 5
      Replies: 4
      Points: 14
      Rank: Member

      Fellow Powershellers;

      I am counting the number of files in a folder – simple. Kind of a loop- have an array of shared/folders.

      when I run the ps script, I am admin. works great. But the PS script, when put in a job will likely need to run under another id.

      That custom ID already exists with the permission to the folders.

      So what is the best way to force security to us the custom id/password before it hits get-childitem

      I would still like to stay with get-childitem.

      Thanks MG

    • #174844
      Participant
      Topics: 1
      Replies: 1635
      Points: 3,089
      Helping Hand
      Rank: Community Hero

      ... But the PS script, when put in a job will likely need to run under another id.

      Why? Who is gonna start this job? That would be the context the script runs in.

      ... or did I miss something again? 😉

    • #174883
      Participant
      Topics: 6
      Replies: 108
      Points: 302
      Helping Hand
      Rank: Contributor
      • Run Powershell console as that user
      • Run the script in a scheduled task that runs as that user
      • Use Start-Process to kick off the .ps1 as that user
    • #174994
      Participant
      Topics: 5
      Replies: 4
      Points: 14
      Rank: Member

      Thanks Charles. I will do that.

      MG

Viewing 3 reply threads
  • The topic ‘Overriding secuirty with get-childitem’ is closed to new replies.