I want to create a folder in the shared top directory of FSx using SSM's PowerShell command.

0

I would like to run powershell commands on a specified EC2 instance using AWS-RunPowerShellScript in Systems Manager's Run Command. I want to create a folder in the shared top directory of FSx, so I carried out the following command.

$path = FSx network drive path
New-Item -Path "$path\D$\folder-name" -ItemType directory

However, access is denied.

I get an error message "Unable to connect to remote server" even after executing the following commands.

$name = FSx name
Invoke-Command -Credential $domainCredential -ComputerName $name -ScriptBlock { New-Item -Path "\D$\folder-name" -ItemType directory }

I would like to know what I should do.

질문됨 2년 전741회 조회
2개 답변
0

Hello! FSx provides you with a Powershell management endpoint to perform commands. Please take a look at the following documentation which explains how to connect to the FSx Powershell management endpoint which you can use to run commands. Please make sure you are using the FSx powershell endpoint name instead of the regular FSx name. If you are already using the FSx powershell endpoint name as shown in the documentation screenshots, please let us know.

https://docs.aws.amazon.com/fsx/latest/WindowsGuide/remote-pwrshell.html#using-rps

AWS
지원 엔지니어
답변함 2년 전
0

Hello!

From the context of an SSM run command, New-Item without credentials will be unauthenticated. That being said, New-Item does support -Credential as a parameter, please try your command again with credentials.

$path = FSx network drive path
New-Item -Path "$path\D$\folder-name" -ItemType directory -Credential $domainCredential

At this time, the FSx PowerShell management endpoint does not support New-Item as a powershell command. For a list of supported commands, please consider invoking a remote session and using Get-Command.

References:

AWS
지원 엔지니어
RJ-D
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠