I want to connect to windows server 2012 which is an aws ec2 instance. I tried using psexec but it showing error as Make sure that the default admin$ share is enabled on WIN-G2QOH****. i tried all possible ways like 1. reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f 2. Go to C:\windows and right-click --> properties and hit 'advance sharing' . From there click the check box 'Share this folder' . Enter the name admin$ and hit Permissions. I would recommend removing 'Everyone' and adding just the users that the PsExec command will use to execute.
Run the PsExec command again and this should resolve your issue.
Edit: You can turn on your AutoShareServer, which will automatically create the admin shares.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\AutoShareServer Change the AutoShareServer key to 1 still it is not working for me..