Not able to perform 'shutdown without sysprep' using powershell in windows server 2022

0

Hi everyone,

I am in the process of creating AWS AMIs for Windows Server 2022. After configuring the machine, I need to perform a 'shutdown without sysprep' using PowerShell with Launch V2. Although I can perform this action using the wizard (as shown in the attached screenshot), I'm having trouble with the PowerShell command.

Any help or assistance in this regard would be highly appreciated.

Thanks!

Enter image description here

asked 6 months ago519 views
3 Answers
0

Hello.

Will sysprep run if I shut down my computer with the command below?
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/stop-computer?view=powershell-7.4

Stop-Computer
profile picture
EXPERT
answered 6 months ago
profile picture
EXPERT
reviewed 6 months ago
  • No i think so

  • If i use this PowerShell command Stop-Computer and shutdown my instance and take a AMI of it It's showing the bellow error

    Password is not available. The instance was launched from a custom AMI, or the default password has changed. A password cannot be retrieved for this instance. If you have forgotten your password, you can reset it using the Amazon EC2 configuration service.

0

If i use this PowerShell command Stop-Computer and shutdown my instance and take a AMI of it It's showing the bellow error

Password is not available. The instance was launched from a custom AMI, or the default password has changed. A password cannot be retrieved for this instance. If you have forgotten your password, you can reset it using the Amazon EC2 configuration service.

answered 6 months ago
0

Hello all, I have manually run the following PowerShell script to prepare the machine without using Sysprep, and it works:

Start-Process -FilePath "$env:ProgramFiles\Amazon\EC2Launch\EC2Launch.exe" -Argument 'reset' -Wait
Stop-Computer

However, when I try to automate this process using Packer, I am unable to RDP into the machine. Can anyone help me resolve this issue?

Thanks, Suriya

answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions