How can I help Powershell to find the remote server? - powershell

Using the Enter-PSSession cmdlet, I get an error that the server is not found. However, I can immediately ping the same server, so I wondering what the error really is and how to fix it. e.g.
Note: I can use RDP to connect to this server and normally do that. However, if I could use PowerShell remote sessions my work would be easier and faster.
Tried again with an ip-based connection (using the ip from the ping, above) and an explicit credential. Failed with a new error:

Related

PsExec connects using system name but not ipAddress

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.

Trouble retrieving DNS Server information on PowerShell

So here's my use case:
Im connecting to a remote windows server machine using the pypsrp python library.
Using the pypsrp.client Client module, I am able to easily execute powershell scripts remotely on my remote machine.
Im trying to fetch DNS server information from my remote windows server.
I am able to retrieve the DNS Server IP via ipconfig /all, however - when using the retrieved IP with any of the following commands I get an error.
For example, I tried: Show-DnsServerCache -ComputerName "10.0.0.5" but It returns the following error:
Failed to get the zone information for ..Cache on server 10.0.0.5.
Any idea if any further configuration from the DNS server side is needed?
Any help would be appreciated!

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.

winexe error: Cannot connect to svcctl pipe. NT_STATUS_ACCESS_DENIED

Am trying to execute the following winexe command, but it throws 'ERROR: Cannot connect to svcctl pipe. NT_STATUS_ACCESS_DENIED.'
winexe -U domain/username%password //windows_machine ipconfig
debug info shows,
ERROR: smb_raw_open_recv - NT_STATUS_ACCESS_DENIED
ERROR: on_ctrl_pipe_error - NT_STATUS_ACCESS_DENIED
ERROR: Cannot open control pipe - NT_STATUS_ACCESS_DENIED
When i have 'winexesvc.exe' in Windows machine, the command works.
My understanding according to http://opensourceinfo.blogspot.com/ is that winexe itself creates winexesvc service, starts it and tries to connect to control pipe. If that's the case, what setting should i have in Windows to resolve Access Denied error and get the service installed successfully? Please correct me if am wrong.
I also came across similar issue in https://sourceforge.net/p/winexe/bugs/35/ post, but am unable to understand the given resolution 'I was trying to log on via a domain user, but only local users were configured'
Note that I have already set,
1. Network Access: Sharing and security model for
local accounts" to "Classic – local users authenticate as themselves
2. LocalAccountTokenFilterPolicy to 1.
So do we need to manually place winexesvc.exe in Windows machine for winexe to work or can we fix the above Access Denied error?
Thanks in advance.

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.