When running the psexec command to remotely install or execute something on a sever on the same network the following error was displayed.
Couldn\'t access Serve
Solution:
You need to add the 'admin$' share which is your C:\Windows location.
C:\windows
and right-click --> Properties
advance sharing
Share this folder
admin$
and hit PermissionsRun the PsExec command again and this should resolve your issue.
Edit:
You can also turn on your AutoShareServer in the registry, which will automatically create the admin shares.
regedit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\AutoShareServer
AutoShareServer
key to 1
In my case it was a network problem like mentioned in the error message.
I needed to allow SMB traffic on port 445 on the target machine. PSExec worked straight away after adding the firewall rule to allow that traffic.
You can also enable amins$ share by enabling File and Printer Sharing (SMB-In) Firewall Rule.
Go to Control Panel > System ans Security > Windows Defender Firewall > Advance Settings > Inbound Rules
. Right click on File and Printer Sharing (SMB-In) from the list and select Enable Rule`. Normally, there are two File and Printer Sharing (SMB-In), one is for Domain profile and one is for Public & Private profile. I'm not sure which profile should be applied, Domain or Public or Private. For me, it's Domain profile.