C++/VB - RpcPing and workstations?

Asked By Gerry Hickman
13-Nov-09 07:16 AM
Hi,

I have been working with RpcPing to test machine availability for use with
WMI.

If I issue the RpcPing command without parameters related to security, it
works on all my servers, even across forests and domains.

RpcPing -s myserver
Completed 1 calls in 15ms
66 T/S or 15.000 ms/T

BUT

If I issue RpcPing against any workstation in any domain without security
related parameters, it fails, and yet I can issue WMI queries against these
machines.

RpcPing -s myworkstation
Exception 5 (0x00000005)
Number of records is: 1
ProcessID is 600
System Time is: 11/13/2009 12:5:29:180
Generating component is 2
Status is 0x5, 5
Detection location is 1750
Flags is 0
NumberOfParameters is 1
Long val: 0x5

So I am trying to understand why I am getting different results with RpcPing.

--
Gerry Hickman
London (UK)
Windows Vista
(1)
Windows 7
(1)
RpcStringBindingCompose
(1)
NumberOfParameters
(1)
RpcStringFree
(1)
ProcessID
(1)
BindingHandle
(1)
Rongchun
(1)
  v-rzhan replied to Gerry Hickman
16-Nov-09 05:15 AM
Hello Gerry,

Thank you for contacting Microsoft Support.

I can repro this issue with Windows WorkStations(Windows Vista and Windows
7). I am now discussing this issue with product team and I will be back to
you as soon as possible.

Best regards,
Rongchun Zhang (v-rzhang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
  Gerry Hickman replied to v-rzhan
16-Nov-09 09:35 AM
Hello Rong-Chun,

Thank you very much for the help with this. I look forward to better
understanding of the RPC mechanism, and why we get different results on
clients and servers.

--
Gerry Hickman
London (UK)
  v-rzhan replied to Gerry Hickman
17-Nov-09 07:08 AM
Hello Gerry,

By discussing with product team, the reason why we cannot rpcping a
workstation without security related parameters is that Workstations don?t
allow anonymous RPC calls by default.

Regards,
Rongchun Zhang  (v-rzhang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
  Gerry Hickman replied to v-rzhan
17-Nov-09 04:03 PM
Interesting! Thank you for this update - it is very helpful. Can you tell
me more information:

1. Where do we find the setting to allow/deny anonymous RPC calls?
2. What is the correct syntax of rpcping to use when checking a remote
machine for WMI readiness?

Thanks.



--
Gerry Hickman (London UK)
  v-rzhan replied to Gerry Hickman
19-Nov-09 07:14 AM
Hello Gerry,

Thanks for your feedback.


I have tried to set the following group policy, but it did work.
Computer Configuration\ Administrative Templates\System\Remote Procedure
Call\Restrictions for Unauthenticated RPC Clients

I will continue discussing with product team and get back to you as soon as
possible.

machine for WMI readiness?

After discussing with product team, they suggest to use WMIC.EXE instead of
rpcping.exe.

Regards,
Rongchun Zhang  (v-rzhang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
  Gerry Hickman replied to v-rzhan
19-Nov-09 03:03 PM
OK thanks. I am just a bit confused about why it is different for servers
and clients and how to turn it on and off. I understand DCOM
permissions, but I think RPC is something different and I do not know how
to change RPC settings...


The problem with using WMIC (or simply connecting to WMI) is that many
people have reported a long delay before receiving "The RPC server is
unavailable". When working with thousands of machines, we do not want
this delay. I do have a system that uses ICMP ping, but with the latest
Microsoft firewall settings, it is no longer useful.

I want to understand the security settings required by rpcping for WMI
operations, so I can create small "rpcping" application, something like
this:

RPC_STATUS status;
unsigned short *StringBinding;
RPC_BINDING_HANDLE BindingHandle;
status = RpcStringBindingCompose(NULL,  // Object UUID
L"ncacn_ip_tcp",           // Protocol sequence to use
L"MyServer.MyCompany.com", // Server DNS or Netbios Name
NULL,
NULL,
&StringBinding);
// Error checking ommitted. If no error, we proceed below
status = RpcBindingFromStringBinding(StringBinding, &BindingHandle);

// free string regardless of errors from RpcBindingFromStringBinding
RpcStringFree(&StringBinding);

the idea is to use lightweight code to test the communication channel
before starting calls to WMI...

--
Gerry Hickman (London UK)
  Gerry Hickman replied to Gerry Hickman
20-Nov-09 04:31 AM
I think I have worked out where the setting resides; it appears to be in the
DCOM access permissions list. On servers I see ANONYMOUS has "remote
access", but on clients it is "Local Only".


--
Gerry Hickman
London (UK)
  v-rzhan replied to Gerry Hickman
24-Nov-09 06:55 AM
Hello Gerry,

Thanks for your updates. I have send you a message to your mail box. Please
check and let me know if you have received it.

Regards,
Rongchun Zhang  (v-rzhang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
  Gerry Hickman replied to v-rzhan
24-Nov-09 04:00 PM
Thank you Rong-Chun, yes I received your message. As I mentioned above,
I have now found the setting that controls the ANONYMOUS access, so this
is now solved. In order to access client and server we must supply
security parameters.



--
Gerry Hickman (London UK)
  scamb replied to Gerry Hickman
18-Dec-09 06:27 PM
Hi All, hello Gerry!

I followed this thread with interest [I am fighting with wmi connections
since wmi appears :-( ]. Please allow me a question, I do not have any
clue about RPC programming.

The code, you demonstrated, connects it really to a remote machine via
RPC or is at just "fumbling" some strings/value to make such a call
possible? It it is the latter, do you have possibly some more code,
which makes really a connection? I am very interested and would need
to port such code to the C# language.

That woule be like the RpcPing you showed [but I would need
C# code].

Anyway, thanks a lot!

br--sca-mb
Create New Account
help
VB6 (and Windows Scripting Host) Sendkeys in Vista and Windows 7 C++ / VB Microsoft has committed to support VB6 applications in Vista and Windows 7. However, it appears that support for VB Sendkeys is still lacking. The latest updates for Windows Vista and Windows 7 appear to support Sendkeys ONLY if UAC is turned off. For
VC++ 6 on Windows 7 / Vista C++ / VB Hi all, please excuse the dinosaur question, but are there any issues with running VC++ 6 on Windows 7 or Vista? Just like to know before I upgrade my PC. Thanks Paul. VC MFC Discussions Windows XP (1 Windows 7 (1) Vista (1) XP (1) Dinosaur (1) Hassles (1) Week (1) Bits (1) If
How to change boot screen for Windows 7? C++ / VB Dear All, Is there any way to change the boot screen for Windows Vista or Windows 7? Can I change it to my customized picture? Thanks Win32 Kernel Discussions Windows Vista (1) Windows 7 (1) You might find this article interesting: http: / / www.withinwindows.com / 2009
Is it possible to install MUI at WINDOWS Vista BUSINESS EDITION C++ / VB Is it possible to install MUI at WINDOWS Vista BUSINESS EDITION, I have to upgrade | SONY Vaio Z11XN Windows Vista Business Edition to WINDOWS 7 ULTIMATE EDITION , but the Vaio's USER activate the machine to the Greek Windows Vista
Visual C++ version 6 and Windows 7 C++ / VB I use Visual C++ Version 6. It works great on XP and at lest for me works on some Vista computers, but not others. Does anyone know if it works on Windows 7? Windows 7 has XP compatibility mode. Does Version 6 work that way? VC MFC Discussions Visual Studio 2008 (1) Windows 7 (1) Vista (1) XP (1) February (1) PSDK (1) Lest (1) I believe VC6