netsh

WCF self-hosted service with transport security (Authentication failed because the remote party has closed the transport stream.)

Hi, I have a self-hosted service that I want to add transport security to. I've set WSHttpBinding.SecurityMode to Transport and the ClientCredentialType to HttpClientCredentialType.None. I've created a certificate and set it to my host with ServiceHost.Credentials.ServiceCertificate.SetCertificate() I've also registered it using netsh h...

What appid should I use with netsh.exe ?

The netsh command wants an appid (see here) : netsh http add sslcert ipport=0.0.0.0:8000 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF} I've not been able so far to understand how I'm supposed to know the GUID netsh wants me to provide. Any hints? ...

"The parameter is incorrect." error using netsh http add sslcert

Following the instructions on "How to: Configure a Port with an SSL Certificate" in this link: http://msdn.microsoft.com/en-us/library/ms733791.aspx, I entered this command on the commandline (duh): C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>netsh http add sslcert ipp ort:10.141.146.227:7001 certhash=5d48e604007b867ae8a69260a...

Cannot get StandardOutput for some process calls in cassini or unit test on win7 64

I am having trouble reading the output from a process when running several processes from .net. One example is the 'netsh' command. I am trying to read all scopes from a dhcp server. It is only failing in web applications and unit tests. In the below code the 'message' is an empty string. var arguments = @"-r myDhcpServer.myDomain dh...

Programatically Create DHCP Reservation in C#

I have been assigned the task of creating an application that takes in a MAC address and creates a DHCP reservation for that MAC address. Is there any API built into .NET to easily accomplish this? Thanks, Matt ...

netsh htpp add urlacl : add reservation for a group

This article explain how to configure a namespace reservation for a user using netsh.exe as follows: netsh http add urlacl url=http://+:80/MyUri user=DOMAIN\user The parameter user= is said to be either user or user-group. It works as described when I configure for a single user, but if I replace DOMAN\user with DOMAIN\Administra...

netsh error on windows 2008 R2

We are upgrading the server from Windows 2003 to 2008. As part of the process, I need to configure a port with a SSL certificate. When I ran the following command: netsh http add sslcert ipport=1.2.3.4:8000 certhash=certificatehash appid={someGUID} I got the following error: SSL Certificate add failed, Error: 1312 A specified logon s...

How do you set up HTTP ACL's for a WCF 3.0 REST application on Windows 7 ?

Hi, I have been reading O'Reilly's "RESTful .NET" and am working with the example program on pg. 24 - 25. This sets up a custom binding for handling REST requests. When I execute the code, it fails as it does not have permission to set up listening on http://localhost:8889/TestHttp According to MSDN (http://msdn.microsoft.com/en-us/l...

Querying a DHCP server in C#

I need to get the mapping of MAC to IP stored on DHCP server, either through a program running on the server itself or preferably through a program running on one of the DHCP clients. I understand netsh utility can be used to get the dump however i have not had much success with that. Any working examples or hint on that? I have admin...

Manually configure WCF to use HTTP on Vista home premium

Hi, I'm trying to develop and deploy a WCF service using VS2008 and Vista home premium. I don't have IIS running and understand I don't need to if I manually configure the WCF app ... using netsh.exe I believe. Can anyone give me clear guidance on how to go from the development project in VS2008 to a useable service? Many thanks. ...

WCF selfhosted service, installer class and netsh

I have a selfhosted WCF service application which I want to deploy by a msi installer package. The endpoint uses http port 8888. In order to startup the project under windows 2008 after installation I have to either run the program as administrator or have to edit the http settings with netsh: "netsh http add urlacl url=http://+:8888/ ...

How do I disable the network connection from .Net without needing admin priveledges?

I may be SOL on this but I thought I would give throw it out for possible solutions. I am writing a computer access control service to help me control my kids' computer use. Plan on open sourcing it when I have it working. It is written in VB.Net and needs to work on XP through 7. I am running into all sorts of security and desktop acc...

C# HttpListener without using netsh to register a URI

My application uses a small webserver to server up some files and have a web interface for administration remotely. Right now the user has to use netsh to register the URI like so netsh http add urlacl url=http://+:1233/ user=Chris-PC\Chris Which is no fun for the average user. I'd like the program to be able to listen on any port sp...

MTU mismatch between GetIfEntry and netsh

I'm working on pseudo-transport layer software that runs over UDP, providing reliable connection-oriented transmission, as an alternative to TCP. In order to maximize network efficiency, we query the MTU of the "best" network adapter upon initialization. MIB_IFROW row = {0}; row.dwIndex = dwBestIfIndex; dwRes = GetIfEntry(&row); Sear...

Servicehost throwing an error, even though added to configuration with netsh

Hey guys, Servicehost.Open() is throwing this error : HTTP could not register URL http://+:8001/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). So I used netsh to add the url. But event though it is added, i'm still getting the error. This is the command i us...

How to get default NIC Connection Name in command line or C#

IMPORTANT EDIT: Back again on this subject. As you said there should be no default NIC, I'm trying to understand if there is a way to detect all the NICs that are actually connected. Having the MAC address of my physical interface is there a programmatic way to get interface name/interface status/etc... For example, my XP machine: De...

Disabling Bluetooth support in Windows XP-7

Hi I'm trying to write a program to disable the Bluetooth service on computers (so, forbid users from connecting to Internet via Bluetooth) I've tried following methods: Disable the "bthserv" service (Bluetooth Support Service). It works on Windows Vista and 7, but there is no such service in Windows XP (I haven't tested, but I think ...

netsh for whitlisting IP Addresses. 4000 IPs, how to add?

Using a little app, I have a few lines that look like the following: netsh firewall add portopening name = "__Auto_WebAccess_TCP_80_IPCount=501_0" protocol = TCP profile = CURRENT mode = ENABLE scope = CUSTOM port = 80 addresses = ip addresses , e.g. 84.22.55.22 and son on comma separated Problem is, the maximum characters you can put...