2017-10-06 1 views
0

powershell.exe를 실행하는 동안 시작 프로세스의 액세스 거부 오류로 인해 아래 코드 &이 생성되었습니다.Azure Powershell 시작 프로세스 : 오류로 인해이 명령을 실행할 수 없습니다. 액세스가 거부되었습니다.

$username = "domain\username" 

$password = "Welcome1234$" 

$PSArgs = "D:\test.ps1" 

$securePassword = ConvertTo-SecureString $password -AsPlainText -Force 

$credential = New-Object System.Management.Automation.PSCredential $username, 

$securePassword 

Start-Process Powershell.exe -Credential $credential $PSArgs 

오류 : -> 사용자 권한 할당

Start-Process : This command cannot be executed due to the error: Access is denied 
Start-Process : This command cannot be executed due to the error: Access is denied. 
At C:\Windows\system32\config\systemprofile\AppData\Local\Temp\PRISMA-AMR-JOB1-87-ScriptBuildTask-8569094554411403512.ps1:38 char:18 
+  Start-Process <<<< C:\Windows\System32\cmd.exe -arg "/C" -Credential $credential + CategoryInfo   : InvalidOperation: (:) [Start-Process], InvalidOperationException 
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand 

답변

0

Start-Process : This command cannot be executed due to the error: Access is denied. At C:\Windows\system32\config\systemprofile\AppData\Local\Temp\PRISMA-AMR-JOB1-87-ScriptBuildTask-8569094554411403512.ps1:38 char:18

이 오류 코드에 따르면, 로컬 컴퓨터 정책에 사용자 "도메인 \ 사용자 이름"을 추가하지 않은 것 같다.

enter image description here

더 자세한 정보에 대한 사용자 권한 할당link을 참조하시기 바랍니다.

또한 여기에서 유사한 경우는 it을 참조하십시오.

:

유형 gpedit.msc, 명령 프롬프트에서 또는 검색에서 로컬 그룹 정책을 연 다음 확인을 클릭하거나 ENTER을 누릅니다.

+0

도메인 사용자가 이미 "인증 후 클라이언트로 가장"로컬 정책에 추가되었습니다. – hans

+0

@hans 제공된 정보가 도움이되는지 확인하기 만하면됩니다. 도움이 더 필요하시면 알려 주시기 바랍니다. –

+0

@hans는 도메인 사용자와 함께이 스크립트를 실행할 수 있습니까? –

관련 문제