PsExec connects using system name but not ipAddress - psexec

I need to use my local computer to simulate a test stand which will be on a domain and access a remote computer which is on a workgroup using PsExec. The testing computer is built from an imaging tool. The IP will be the same every time but the name isn't. The process I'm working with was used on an embedded XP system and is now being upgraded to WIN10. I've added network security using GPO and have found workarounds to be able to open the connection but for some reason just trying to run cmd on the remote machine does not work when using the IP, only the name. Using the IP returns the "access is denied" error. I have already added the token filter key to the registry. Has anyone heard of something like this before?
I have a script I'm trying to run but in the meantime I'm just trying to get
psexec \IP_ADDERESS -h -u USER_NAME(this is an admin) -p PASSWORD cmd
edit: I have to keep my computer on a domain but I have a spare that I was able to put on a workgroup with the test system. Running psexec went perfect. It makes no sense why it works for the name and not ip on a domain->workgroup connection and works exactly how I need it to on a workgroup->workgroup connection.

Related

Is it possible to run Copy-VMFile powershell command as non-admin?

I have a host machine with Hyper-V enabled, and I have a Hyper-V guest running on this machine. Becauze I can't drag&drop files to the VM, I wrote a script to do this for me, which is integrated in TotalCommander, and which uses Copy-VMFile.
My problem is that the PS script works only if I run it as admin, otherwise I get the error "You do not have the required permission to complete this task."
Why do I need admin to copy from the host machine to the guest OS? And is there a way, some policy which would allow me to circumvent this? It is annoying to enter a password every time I want to copy some files.

PSS-Remoting problem while connecting to a connection broker to retrieve sessions

Tryin to be synthetic, I'm trying to connecting from a W7 operating system to a connection broker in order to retrieve all of the user's sessions with this simple function:
Get-RDUsersession -connectionbroker 'xx' -collectionname 'xx'
Since I discovered that it can't be done from W7 because the remotedesktop module can't be downloaded even after installed RSAT, some users advise me to use PSSRemoting commands in order to send command on a remote computer where surely the function works and thanks to this way run the entire script i've made on the local computer.
The problem, as you can see in the image attacched, is that it keeps me prompt out this error:
A remote desktop services deployment does not exist on server.se
The same command works on W10 and i'm sure the RDS Deployment exist on that server. I've tried a lot of ways but i can't figure out why it doesn't works.
Someone can help me out ?
You're not really running your command using PowerShell Remoting (H: is not on the remote system as you can see in your screenshot).
Connect to the remote system using:
Enter-PSSession -ComputerName "yourRemoteMachine"
and the run your Get-RDUsersession -connectionbroker "xx" command.

PsExec is not working on Windows 10 Pro due to "Access denied" error

GOAL
Remotely access from a machine to another, using psexec, in order to start/stop a net service.
CONFIGURATION
Windows 10 Pro on both machines
PsExec v2.2
ISSUE
Couldn't access MACHINE_IP:
Access denied.
PREMISE
from now on, I'll refer to those machines as A and B
A is able to ping B
the accounts I used to accomplish that task are both administrators
WHAT I'VE TRIED
The first attempt was quite simple; so, from A, I ran:
psexec \\B_IP -u B_ADMIN_NAME -p B_ADMIN_PWD net stop SERVICE_NAME
but, as a result, I got the "Access denied" error.
Searching for the issue, I've found a lot of possible solutions but, unfortunately, noone worked for me. Here's what I tryied:
disable Windows Defender on A and B
disable User Account Control on A and B
uncheck "Use Sharing Wizard" from "Folder Options > View > Advanced Settings" on A and B
add the new DWORD (32-bit) LocalAccountTokenFilterPolicy (set to 1) inside "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" on A and B
save credetials before execute psexec using cmdkey.exe /add:B_IP /user:B_IP\B_ADMIN_NAME /pass:B_ADMIN_PWD
try to get admin permissions on remote PC before using psexec with net use \\B_IP\ipc$ /user:B_ADMIN_NAME B_ADMIN_PWD
try to run psexec as administrator using runas /user:B_ADMIN_NAME "psexec -e -h -s -u B_ADMIN_NAME -p B_ADMIN_PWD \\B_IP cmd /C net stop SERVICE_NAME"
Another strange thing is that A cannot access to B via filesharing.
To be precise, it can access to \\B_IP but not to \\B_IP\C$ nor \\B_IP\ADMIN$.
I think those two issues (access denied with psexec and filesharing) are somehow related but, as I said, noone of the previous solutions worked for me.
Any other ideas would be very appreciated.
Thanks.
IIRC the admin$ share uses SMB1/CIFS which 1709 or 1803 automatically disabled because MS considers SMB1 not secure enough.
(If you're using a samba server and your windows client cannot access network shares anymore after upgrading to one of these versions, the answer below should also work for you)
It has to be manually reactivated through "turn windows features on or off"
full name : SMB 1.0/CIFS File Sharing Support.
Be aware that this feature contains both client and server, be sure to expand the feature's tree to check if you correctly install the one you need (server for psexec, client for network shares)

Alternatives for PsExec which works in standard user

I am using psexec to execute commands on remote server. Here is my command,
PsExec.exe" -u user \\server -h run.bat
I am entering the password manually. here I am using standard user account due to security issues. When I run the command I am getting the error,
"Make sure that the default admin$ share is enabled"
I read here that it cannot be done without admin privileges.
But when I test the same command in LAN it works in standard user.
How it works in LAN not in Remote server ?
Is there any alternative tools which will work in standard user ?
Please help me.
As an alternate tool, you can use Powershell and WinRM. Powershell allows you to execute a command, or an interactive session, on the remote windows server.
An example of executing a command is available here:
How to programmatically/remotely execute a program in EC2 Windows instance
If you need an interactive session, look at the Powershll command 'Enter-PSSession': https://technet.microsoft.com/en-us/library/hh849707.aspx

Can't connect to my server with restric RSYNC (RRSYNC)

I explain my problem:
I used backuppc for remote some database on an other server and for saving my data I used rsync which uses ssh. On my remote server I put the ssh key of backuppc and it worked.
But I wanted to secure this connexion, so I used rrsync (a perl script for restrict the access), for a "read-only" access with copy.
So now, in the remote server I have in root/ssh/authorized_keys
command="/usr/local/bin/rrsync -ro /" ssh-rsa
But when I try to connect I have this message:
/usr/local/bin/rrsync: Not invoked via sshd
It's a message from the perl script, but I don't know what it means or what can I do for this to work.
As far as I can tell, this message appears when you try to access the server with the restricted key without using rsync. It may be possible to edit the script to allow other programs, but I'm not skilled enough to attempt that.