[{"data":1,"prerenderedAt":86},["ShallowReactive",2],{"/2025/10/11-unable-to-getpassword-on-aws-ec2-launched-from-windows-server-2016-custom-ami":3},{"id":4,"title":5,"body":6,"date":77,"description":73,"extension":78,"meta":79,"navigation":80,"path":81,"robots":82,"seo":83,"stem":84,"__hash__":85},"posts/2025/10/11 unable-to-GetPassword-on-AWS-EC2-launched-from-Windows-Server-2016-custom-AMI.md","11 Unable To GetPassword On AWS EC2 Launched From Windows Server 2016 Custom AMI",{"type":7,"value":8,"toc":74},"minimark",[9,18,25,28,40,53,61],[10,11,13],"post-title",{":date":12},"date",[14,15,17],"h1",{"id":16},"unable-to-getpassword-on-aws-ec2-launched-from-windows-server-2016-custom-ami","Unable to GetPassword on AWS EC2 Launched from Windows Server 2016 Custom AMI",[19,20,21],"notes",{},[22,23,24],"p",{},"This is a repost from my old blog. First posted in 11/19/2018.",[26,27],"br",{},[22,29,30,31,39],{},"We found out that our custom AMI doesn't allow us to enable GetPassword from AWS console on any EC2 launched from it. After reading and some trial and error, we found out that ",[32,33,38],"code",{"className":34},[35,36,37],"bg-gray-200","p-2","rounded","InitializeInstance.ps1"," has to be enabled for the next boot.",[22,41,42],{},[43,44,47],"span",{"className":45},[46],"text-blue-600",[48,49,50],"a",{"href":50,"rel":51},"https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html#ec2launch-inittasks",[52],"nofollow",[22,54,55,56,60],{},"To be complete, ",[32,57,59],{"className":58},[35,36,37],"LaunchConfig.json"," has to have adminPasswordtype set to Random (default). Then, run the following PowerShell command:",[62,63,64],"code-block",{},[65,66,71],"pre",{"className":67,"code":69,"language":70},[68],"language-text","C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeInstance.ps1 -Schedule\n","text",[32,72,69],{"__ignoreMap":73},"",{"title":73,"searchDepth":75,"depth":75,"links":76},2,[],"2025-10-11T00:00:00.000Z","md",{},true,"/2025/10/11-unable-to-getpassword-on-aws-ec2-launched-from-windows-server-2016-custom-ami",null,{"title":5,"description":73},"2025/10/11 unable-to-GetPassword-on-AWS-EC2-launched-from-Windows-Server-2016-custom-AMI","L0jPo0PFVHZ-RBuQxicSWwRRtAvVEIqvs1edEDf8vtY",1785167452912]