Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

NetRemoteComputerSupports (netapi32)
 
.
Summary
Queries the redirector to retrieve the optional features the remote system supports. Features include Unicode, Remote Procedure Call (RPC), and Remote Administration Protocol support.

C# Signature:

    [DllImport("Netapi32.dll", EntryPoint = "NetRemoteComputerSupports", CharSet = CharSet.Unicode)]
    private static extern  Int32 NetRemoteComputerSupports(String uncServerName, NetSupportOption optionsWanted,ref NetSupportOption optionsSupported);

[DllImport("netapi32.dll", SetLastError=true)]
static extern TODO NetRemoteComputerSupports(TODO);

VB Signature:

Declare Unicode Function NetRemoteComputerSupports Lib "Netapi32.dll" ( _
     ByVal UncServerName As String, _
     ByVal OptionsWanted As NetSupportOption, _
     ByRef OptionsSupported As NetSupportOption) _
     As NET_API_STATUS

User-Defined Types:

NET_API_STATUS - Possible value are NERR_Success, ERROR_NOT_ENOUGH_MEMORY and ERROR_INVALID_PARAMETER.

<System.Flags()> _
Public Enum NetSupportOption As Integer
     Any = -1
     RemoteAdminProtocol = 2
     Rpc = 4
     SamProtocol = 8
     Unicode = 16
     Local = 32
     Error = -2147483648 'Not a possible value for OptionsSupported - can be used to indicate an error from the API
End Enum

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample VB Code:

Function RemoteComputerSupports(ByVal ComputerName As String, ByVal Wanted As NetSupportOption) _
   As NetSupportOption
     Dim supports As NetSupportOption
     If NetRemoteComputerSupports(ComputerName, Wanted, supports) = NET_API_STATUS.NERR_Success Then
     Return supports
     Else
     Return NetSupportOption.Error
     End If
End Function

Sample C# Code:

    [System.Flags()]
    public enum NetSupportOption
    {
    Any = -1,
    RemoteAdminProtocol = 2,
    Rpc = 4,
    SamProtocol = 8,
    Unicode = 16,
    Local = 32,
    Error = -2147483648 //Not a possible value for OptionsSupported - can be used to indicate an error from the API
    }

    static void Main(string[] args)
    {
        NetSupportOption Want = NetSupportOption.Any;
        NetSupportOption Has = NetSupportOption.Error;
        Debug.WriteLine(NetRemoteComputerSupports("{SERVERNAME}", Want,ref Has));

    }

    [DllImport("Netapi32.dll", EntryPoint = "NetRemoteComputerSupports", CharSet = CharSet.Unicode)]
    private static extern  Int32 NetRemoteComputerSupports(String uncServerName, NetSupportOption optionsWanted,ref NetSupportOption optionsSupported);

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions