windows service command RPC error (sc.exe or psservice) - windows

I am getting the following error when i try to run the command from remote machine
C:\>sc \\machinename query
[SC] OpenSCManager FAILED 1722:
The RPC server is unavailable.
I have admin privileges to that machine.
Any solution let me know.

In my case I got this error because I was messed up the name of the server I was targeting. It will give you this error if you accidentally point it at nothing. In my case, the server name was a variable being defined from a text document so it took a while for me to realize.
Also noteworthy: There should actually be two slashes before the machine name (I'm sure it's just a typo, but just in case it could confuse anybody).

The error 1722 is : The RPC server is unavailable.
Verify if RPC service (Remote Procedure Call (RPC)) is running at remote machine with telnet, try at command line:
*>telnet your.server 135
If no errors occurs the RPC server is probably ok, than check system events for issues.

6 years later but anyaway.
Enable File and printer sharing on the remote computer and it will work.
https://support.microsoft.com/en-us/kb/323790

I tested on my localmachine
I tested from another machine on the network
SC is nice..! :)

You need to make sure that the Client DNS service is not stopped. This fixes the problem.

Related

Unable to RDP into windows?

I have a windows 16 machine on AWS. I installed Cygwin on it so that I can connect it as a jenkins slave. But once I connected it as a slave, I am NOT able to MSTSC/RDP into the machine. I can still access the machine via ssh/cygwin.
( I repeated the process several times and ended up losing rdp connectivity everytime )
This is what is actually happening now :
The EventLogs on machine are saying that logoff instructions are being initiated by the RDP client.
RDP client is saying "The disconnection was initiated by the user logging off their session on the server"
Visually, if seems like the remote connection was setup for a split second. Then it vanishes.
So, I believe that somehow my Administrator account is not able to maintain the session. It's getting disconnected as soon as it connects.
Can you suggest me which settings should I debug into ? I am able to extract a few details from my machine using ssh, but I can't explore all the settings.
If you are familiar with this behaviour please suggest me what settings might be reponsible for this.
Addition info:
If I restart my ec2 , it will never come back because a status check starts failing
I am able to telnet to 3389 port. So I guess, firewall rules are not an issue.
I have tried various RDP clients, on MAC as well as on Windows.
I found this in event log (ProviderName: Microsoft-Windows-RemoteDesktopServices-RdpCoreTS) on my remote windows machine:
5/10/2019 3:13:44 PM 103 Information The disconnect reason is 12
.
.
.
5/10/2019 3:13:43 PM 228 Warning Disconnect trace:CUMRDPConnection Disconnect trace:'calling spGfxPlugin->PreDisconnect()' in CUMRDPConnection::PreDisconnect at 4477 err=[0xc], Error code:0xC
It turns out the my problem was occuring due to some cleanup utility deleting up the system files required for mstsc.
Everything started working fine after I switched off the cleanup utility.
Thanks for the help though.

ngrok killing a tunnel from windows 7 command line

I'm trying to use ngrok to foward my app, currently hosted on localhost:3602, to my development partner.
I've done this many times in the past successfully, simply by typing in
ngrok http 3602
I get back a url that he can conntect to. But now when I type that in I get the following error message:
Tunnel session failed. Your account is limited to 1 simultaneous ngrok client session.
Active ngrok client sessions in region 'us':
- f21bd0dbe67928069054c733a5e11f88 (54.80.69.18)
ERR_NGROK_108
Obviously I must have an existing tunnel session running somewhere.
My problem is I have no idea where to find that existing tunnel session and how to terminate it. It does not exist as either a running application, process or service in the task manager, and I can find no syntax in the documentation for how to terminate a tunnel session. I've tried rebooting my machine to no effect, which tells me this is probably not a local problem, but rather something running on the ngrok site linked to my account, yet nothing I can find in my account settings indicates anything helpful.
Can anyone provide the necessary command to clear up this problem. Thanks.
for window version:
tskill /A ngrok
For Linux/Mac
killall ngrok
This command is an Unix command. In Windows maybe you can open the Task Manager and close all ngrok processes.
This answer is not about killing tunnel, but about a possible solution to the described problem with ERR_NGROK_108.
https://dashboard.ngrok.com/get-started/setup
describes a simple plan for getting started with ngrok.
If you execute the second step you will have a file ngrok.yaml (In my case path was: C:\Users\Mi\ .ngrok2\ngrok.yml).
And after that executing ngrok http 80 will provide the described error ERR_NGROK_108.
Solution:
Skip the second step. Execute ngrok http 80 without previous ngrok authtoken
If you have already executed this step, delete the file ngrok.yml
This approach solved my problem with ERR_NGROK_108.
on your ngrok prompt just run this command
taskkill /f /im ngrok.exe
It seems like ngrok got a (JavaScript) function for that:
const ngrok = require('ngrok');
ngrok().kill();
If you are limited to one session — like I was. Then you may have created an account with ngrok and signed in with your machine. And it'll create a file:
C:\Users\<name>\.ngrok2\ngrok.yml
It uses this to limit your client, simply delete this file.
On Windows(cmd):
taskkill /f /im ngrok.exe

SQL Server 2016 linked Oracle Server - Suddenly stopped working

After rebooting my Windows Server 2016 Standard (SQL Server 2016) my SSIS process that runs this query:
select * from openquery(HRMPROD, 'SELECT QUERY HERE' )
started failing with this error:
I get the same error if I try to run the query in SSMS. I have the same linked server set up on my test instance and the query is successful when I run it there. I have compared the linked server create script on both instances and it is the same.
Any idea where I should look for what is causing the connection issue on the one server but not the other?
Thank you.
Saying the answer is on the Oracle side is just like pointing fingers across the way. Let's just fix the issue here.
There is a connection string that is used from SSIS, (which you also used in SSMS) The connection string contains three main components to connect and would result in the 12154 error if any of them were incorrect:
Host
Instance name (different than Instance on Sql Server, think database name)
port
The port most likely hasn't change, neither has the database name, but the host...No, hasn't changed, but the DNS server used to connect most likely has! I would ping the host and see what returns from the SSIS and your SSMS host that you're using. I would expect it to fail. Find out what IP address the host is using and ping that - see if it returns. I'm guessing that's the change that needs to be updated or your Network folks need to fix a DNS configuration/server issue.
Hope this helps!
Kellyn
Since you are getting a response from the TNS Listener, the problem lies on the Oracle side. See Architecture of Oracle Network Services for an overview of how the Oracle networking handles things. Keep in mind that based on the error message you've reached the TNS Listener, so you only need to check things between TNS and the Oracle database... In other words, your networking and SQL Server settings are fine or you wouldn't be able to get this error message.
I would agree with above that the issue might have to do with the network. I have come across that a few times, where we can set everything up, but a firewall is blocking communication between the two servers.
Open up powershell on the new server and run a tracert to the target to see the hops and identify if is connecting across the network.
If it is, then run a test-netconnect on the specific port, to see if the port is open from the firewalls.
Cheers!

I used WMIC and I got error: RPC server is unavailable

I would like to use WMIC and get products information about all PCs.
So I tried:
wmic /node:"IPAddress" /user:"domain\administrator" /password "Password" /output:c:\test.txt product get name, vendor
It does not work with all PCs.
I got error: Description = RPC server is unavailable.
Is there any idea to solve this problem??
And the service is running (Remote Procedure Call)
Thank you for your help.
Probable reason:
Firewall configuration (RPC connections blockage)
You don't enough permission to run WMI queries.
Machine is not reachable. Try pinging the machine.
Second point is valid if you are trying to run queries on remote machines. You can use wbemtest to verify.
Windows+R (run command)
Type wbemtest
Once UI is opened, try to connect to the machine which is throwing exception.

SQL Developer error: got minus one from a read call [duplicate]

I connect to a database with read only access using SQL developer. It's a TNS connection. I use a tnsnames.ora, forwarding port script and SQL Developer.
In the past, occasionally, when connecting, I get a error message
Got a minus one from a read call.
Vendor Code 0
If I do a reboot, it goes away. Another friend suggested changed the forwarding port which worked for him.
I recently upgraded to a new computer and now it seems that I am getting the error message consistently. Reboot or changing forwarding port does not help at all.
The port forwarding script contains something like this
putty -L (port):(machine name):1521
Does anybody have any idea? Thanks.
My port forwarding script forwards multiple ports. Somehow separating them into 2 smaller file, this error went away.
Check your sqlnet.ora file and comment if there is any entry like the below.
tcp.validnode_checking = yes
tcp.invited_nodes=(<hostname_1>, <hostname_2>)
Now reload your listener and check the connectivity from SQL Developer.
lsnrctl reload <SID>

Resources