Can't access server with username that has spaces

1

1

I amn trying to test out how PsExec work. However, even when I'm trying to simply send a 'echo Hello', with the correct password and everything, it says that couldn't access the other computer.

Here's what my command looks like:

C:\PSTools>psexec \\COMPANY-PCNN -u "COM Pany - PCNN" -p PCNN echo Hello

PsExec v2.2 - Execute processes remotely
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals - www.sysinternals.com

Couldn't access COMPANY-PCNN:
Access is denied.

MarcolinoIM

Posted 2019-01-08T14:40:36.770

Reputation: 11

Not an expert, but could it be that the user should perhaps be specified with a domain (e.g. "domain\COM Pany - PCNN") – Saaru Lindestøkke – 2019-01-08T15:11:34.663

That (include the domain) seems correct because a local user account on the target system will be the default. In addition, I suggest getting out of the habit of including the password in the plain-text command, and instead get prompted for it instead (and this would also verify if it is trying to use a local account on the target system or the domain account.) – Debra – 2019-01-08T20:33:27.383

For the time being I have put on hold researching PsExec. I will try it again later. Thanks anyway – MarcolinoIM – 2019-01-09T13:28:29.417

Gotta ask: Why do your usernames have spaces? Passwords can have spaces because... because. But to to spaces in a username just seems to me to be asking for problems. Yes, they are officially supported in an AD environment, but EVERY best practice source out there will strongly recommend against them for, among other reasons, precisely what you're experiencing here. – music2myear – 2019-01-10T16:30:58.273

No answers