Can C# block internet access on a remote Windows PC - c#

Using C#, is it possible to iterate over a list of remote Windows computers connected to the LAN and turn on/off internet access for specific PCs only and while the internet connectivity is provided via a router? And all that without installing any client software on the remote PCs.

This answer might better be served as a comment, but it is a little long to write there.
You should look into creating a Group Policy.
This is what our local Network Administrator does.
We have hundreds of PCs out on our production floor that have to connect to our network to access data over the local server and server at our remote plants.
These PCs access our network via a Public profile, which does not have Internet access.
We also employ multiple servers (applications server, mail server, web server, sql server, etc).
When the Public account is logged in, the router denies traffic to the web server.
If a manager or supervisor needs to look up a part out on the production floor, they can log in with their account (i.e. not the Public account) and access Internet information.
Lucky for me, you did not ask HOW to do this, because I am not really sure how this is done. You only asked if it was possible.

Related

Windows authentication in IIS Express over VPN

I am working on a C# .Net MVC application that uses Windows authentication. When I am in the office, on my work computer, all is well. However, the same code base on my personal laptop will not authenticate. I'm not sure what username:password combination it is looking for. I have tried both my local credentials and my work credentials. I am connected via VPN to the office and can browse network resources, connect to SQL servers, etc. I suppose to complicate matters, I log into my personal laptop using a Microsoft account (which I am considering dumping).
Is there any other info that you need? What else can I try. I can't figure out where the entry point into my code is happening to attempt a debug.

Connecting to SQL Azure database from client applications

I have a bunch of small desktop applications for which I have a simple database for keeping user data (who uses which app and in which version) etc.
I want the apps to connect to Azure SQL server and update database record when they're started. My apps have the ADO.NET connection string hardcoded in them.
It works fine from my home network and my company guest network - however, the corporate network has got some of the ports disabled, and that apparently includes port 1433. As per Microsoft troubleshooting guide, I tried telnet and failed.
C:\Users\xxx>telnet 65.55.74.144 1433
Connecting To 65.55.74.144...Could not open connection to the host, on port 143
: Connect failed
I cannot connect neither via my applications, nor by SQL Server explorer in Visual Studio.
So, the question is - how can I get around this problem? It is highly doubtful that corporate IT will unlock a port just because I ask, besides I want to keep it as simple, low profile and independent as possible. Or maybe my approach is incorrect from the very beginning and I should do stuff differently?
Cheers
Bartek
You can't.
Make your desktop applications talk to web services instead, over HTTP/HTTPS. Among other things this will also allow a more controlled access (right now anyone can connect to your database and modify the data, since your access credentials are publicly shared with your app).
A side effect of using we services is that 80/443 are almost always opened in all corp firewalls.

How can I redirect URLs entered in the browser?

I want to redirect URLs entered in the browser. For example, when I enter http://microsoft.com, it would redirect to http://127.0.0.1:5000/webpage.html and show this page. I want to do this for all websites entered in the browser.
I don't want to do it by ASP.NET.
I have 10 computers in a workgroup network. I want to manage them by a system that it is server.
My program has 2 client and server versions. Client versions install on PC Clients.
I want to be able to get the client bandwidth systems, And if the bandwidth is over, I redirect browser to a page or port (127.0.0.1:32500) and I stop communicating with internet for all programs on PC Clients. I know that I use proxy, but how?
If I set proxy for browser, other programs can connect to Internet without cross through the proxies.
I want to make a program like net support schools that I can control internet on client (Web access in net support).
I would do this by creating entries in the Windows HOSTS file (C:\Windows\System32\Drivers\etc\hosts).
This is a permanent redirect until the hosts files is changed again.
Also, please be aware that Windows maintains a DNS cache, so if you use something like this, you may have to tell windows to flush it's DNS cache. That can be done by using the command:
C:> ipconfig /flushdns
if you have 10 computer,
1-it's better you put a server like one of them and on the server start dns server like 192.168.1.1 and manage all site and ip you want and for clients set dns on you dns server.
2-it's easier, but if your network bigger you can't administer that. You must open every client hosts file (C:\Windows\System32\Drivers\etc) and add row like
127.0.0.1:32500 microsoft.com
if you want change this file you must run as administrator.

How do you validate Windows user credentials on a different machine over a WiFi or LAN network?

I am on machine "MACHINEA" in my WiFi or LAN network, and am trying to authenticate a user with username "testusername" and password "testpassword" on machine "MACHINEB" in my WiFi network. I don't have a domain controller on this network. I want to validate credentials on a regular machine, just because it is visible on the network. I would like a solution or suggestion in C#, but I am open to other suggestions in other languages if I can fork into a different process that can return a value to me in a different language (if possible, please explain how I could do this as well).
I don't know what the equivalent in C# is but in C you can do this using the WNetAddConnection2 function. Note that this requires that you don't already have a connection to the computer, and that the computer is configured for authentication (i.e. simple file sharing is turned off.) You don't need to specify a local name for the connection.

Computer A can reach network web service, while computer B can't. Any ideas?

You'll have to pardon me as I wasn't sure where to place this. This overlaps in the areas of C# Web Services and Network/Security management I suppose.
I have a server that runs various web applications. One of them is a web service. The account everything runs under is a local account on the machine. It is not a domain account. I don't know why this was done how it was, but it's one of those things that's just the way is because it's the way it was done.
Super, huh?
Okay so my domain account name is given full permissions on the web serivce. Now, while the account the web service runs under is not a domain account, the machine is on our domain and in our network. So, from my computer, I can fire up a browser and type in the url to the web service in this fashion:
http://serverhere:porthere/servicename
Now the fun part. From a different machine on the same network and logged in my domain account, I cannot load the web service.
Here is the really, really nutty part. From both machines A and B, I cannot ping the server hosting the web service. Might be because pinging is turned off.
So the million dollar question is, does any one have any idea's at all as to why computer B cannot access the web service while computer A (my machine) can?
The server hosting the web service is running windows 2000. My machine is running windows xp. The machine that cannot load the web service is running Windows 2003 SP 2.
Check to make sure the subnet masks for both machines are the same; if one subnet is more restrictive than the other, it'll basically ignore messages from that machine.
There are too many options for this. And I would not bet on account permission issue. You should check the communication with network sniffer, like wireshark or network monitor. Check proxy settings. and post more information about the error you receive.
Silly suggestion, but did you check the firewall settings on the 2003 machine?

Categories