Error:1722 Getting session names - server

I am trying to check if anybody is connected to the server in my team with the following command: query session /server:<SERVERNAME>. But Every time I end up getting the following error:
Error:1722 getting session names.
Error[1722]: The RPC sever is unavailable.
I have already tried with qwinsta but i get the same issue in there too.
Is there anyway to get around the issue and get the required?

launch regedit.exe (You have to be administrator to do that)
goto:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
and change AllowRemoteRPC from the value 0 to the value 1
on each machine which should be able to receive a message

For me, the one Windows Server 2012 R2 giving this error was fixed by adding the following rule. None of the 97 other had the issue.
netsh advfirewall firewall add rule name="Open Port 135 RPC" dir=in action=allow protocol=TCP localport=135
netsh advfirewall firewall add rule name="Open Port 135 RPC" dir=in action=allow protocol=UDP localport=135
netsh advfirewall firewall add rule name="Open Port 445 RPC" dir=in action=allow protocol=TCP localport=445
netsh advfirewall firewall add rule name="Open Port 445 RPC" dir=in action=allow protocol=UDP localport=445

Try sharing a folder in the target computer, also store credentials of target user in the source computer.
eg:msg /Server: targetipaddress targetUsername "Message"

Related

How can I connect my flutter project to postgresql database? (ubuntu 20.04)

I tried using flutter dependency "postgres" but my connection is refused. I also don't know how to start my postgresql server on ubuntu or call it using a restapi.
Hay ,, you want to connect flutter app to postgresql right?
Firstly you can't use flutter in web mod to postgresql
1-> Create a user in postgresql, something like username flutter password flutter, give permission for that user to read the table. easy commands
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO flutter;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO flutter;
2-> Configure your postgresql database for created user (eg.flutter)
https://blog.logrocket.com/setting-up-a-remote-postgres-database-server-on-ubuntu-18-04/ check that link to configure postgresql.conf and pg_hba.conf
after that test connect by psql command ->psql -h (host) -d (database) -U (user)
host databasename flutter 0.0.0.0/0 md5 inhba
listen_addresses = '*' inconfig
3-> Add fire wall rule,,
for windows
netsh advfirewall firewall add rule name="postgresin" dir=in action=allow protocol=TCP localport=8069
netsh advfirewall firewall add rule name="postgresout" dir=out action=allow protocol=TCP localport=8069
4->https://pub.dev/packages/postgres try

Unable to connect to Mongo Db Remotely

I'm currently running 3.6 MongoDb on my local computer. I've downloaded the community edition, and am able to connect via Robo3t aka robomongo.
I've installed the mongoDB instance on my Windows 10 machine like so:
mongod --install --logpath c:\mongodb\logs --logappend --bind_ip [127.0.0.1,0.0.0.0,192.168.0.141] --dbpath c:\data\db
I have also tried this with just 0.0.0.0. Same behavior
And I ran it:
net Start MongoDB
I'm able to connect to it locally:
I've opened up my firewall to allow connections of all types on my Windows machine:
netsh advfirewall firewall add rule name="Open mongod port 27017" dir=in action=allow protocol=TCP localport=27017
I got my public IP address from "What's my IP", say xxx.xxx.xxx.177.
This is my current setup on Laptop1. Everything looks good.
So on Laptop2, I can ping xxx.xxx.xxx.177 no problem. But if I do a telnet xxx.xxx.xxx.177 27017 on Laptop2 I get a connect failed.
What steps am I missing, and what else can I do to try to connect to Laptop1? Everything seems to be running correctly locally.

How do I disable a LAN (Local Area Network) connection?

I understand the command to show the Windows XP firewall status is:
netsh firewall show opmode
Which outputs:
To disable firewall type:
netsh firewall set opmode mode=disable profile=all
Which outputs:
But I cannot find the command to disable the Local Area Connection.
How can I do this?
I cannot find the command to disable "Local Area Connection"
You need to use the interface option of netsh.
To disable:
netsh interface set interface "Local Area Connection" admin=disable
To enable:
netsh interface set interface "Local Area Connection" admin=enable
Notes:
Replace Local Area Connection with the interface names of your adapter.
Use netsh interface show interface to get the interface name.
Further Reading
An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
netsh - Configure Network Interfaces, Windows Firewall, Routing & remote access.
Netsh commands for Interface IP
Netsh Commands for Wireless Local Area Network (WLAN)

Redirect port on Windows from loopback to outside

I have a socket that listen on port 6100 on my development machine, whose lan address is 192.168.1.2
I can access the socket and use it with the address 127.0.0.1:6100, but I can't access it from 192.168.1.2:6100 (I need to access the socket from another client on the Lan)
If I type netstat -an | find "6100" on the command prompt I get:
TCP 127.0.0.1:6100 0.0.0.0:0 LISTENING
So I need to redirect all calls to 192.168.1.2:A_RANDOM_PORT to 127.0.0.1:6100
How can i do that?
I tried with:
netsh interface portproxy add v4tov4 listenport=6200 listenaddress=192.168.1.2 connectport=6100 connectaddress=127.0.0.1
But without luck
I've finally been able to accomplish this task, but only using an external tool.
I downloaded "PassPort port forwarding utility" and set up a redirection from 192.168.1.2 to 127.0.0.1
Unfortunately I haven't been able to do that without an external tool.
You failed to post the code concerned, but you bound your listening socket to 127.0.0.1 instead of 0.0.0.0. Just fix that. No oort forwarding required.

Changing IP address via command line on Windows XP

I'm trying to change a machine IP address via cmd.exe with this code:
netsh int ip set address name="Local Area Connection" source=static addr=???.???.???.??? mask=255.255.255.0
The problem that the IP doesn't change (checked by ipconfig) but doesn't not changed on the DHCP. Thus when I restart the machine, the IP is returned to DHCP.
I need a way to change the IP permanently via command line.
Any ideas?
You can use the command below:
netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1
where
the 192.168.0.100 is the IP address
the netmask is 255.255.255.0
and the gateway is 192.168.0.1
You can also have the DNS configured automatically by DHCP using following command:
netsh interface ip set dns "Local Area Connection" dhcp
If you are looking for change it regularly here is a trick :)
netsh interface ip set address name="Wi-Fi" static 192.168.1.140 255.255.255.0 192.168.1.1 // this change IP
netsh interface ip add dns name="Wi-Fi" 8.8.8.8 index=2 //this change DNS
pause
type above in notepad and save as ip.bat.
run the file as administrator