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.
I have a windows network (not connected to domain) and I need to provide some automation on each PC at certain time of the day. There are several tasks - launch executables, managing FS, transfering files. All this actions must be implemented via RDP, using C#. What is common approach to achieve this? I don't have experience using RDP within software. So are there .NET classes or free libraries I can use to get RDP functionality in my software. Thank you!
All the tasks you have listed relyed much more on security issues for machines within your network and a user logged-in priveledges a rather than a usage of RPD.
Within a windows domain the tasks like yours are usually delegated to ActiveDirectory administration and policies.
In case of a not Windows Domain Network you will need to use a mechanism that will be presented in following configuration:
a client installed on each particular machine under proper permissions. The client should implement a subscriber pattern.
a server installed on a "commander" machine. the server should inplement a publisher pattern.
There should be a lot of ready solution that should implement the concept of content disribution and starting specific scripts. I think that your investment in such tools research and evaluation will be much more time- and cost- effective rather than writing an app that "uses RPD functionality"
But if there is a reason that prevents usage of 3rd parties, I would go for implementaion of WCF service that will be installed on all clients. This service should be "trained" to do all your suff on client. Server side you will need an appliaction or a service that will publish events for clients or trigger known clients methods.
I have desktop app on server, that can be used by clients via Microsoft RDP or RemoteApp or Citrix ICA. And now i need to somehow interact with REAL user desktop from that application running on server in RDP/RemoteApp/ICA session.
Is there exists some server-side API in Microsoft RDP/RemoteApp or Citrix ICA that can be used to implement this?
My app is currently written in C#, but i can easily use COM/WinAPI if needed.
Yes, on Citrix you can use the Virtual Channel SDK:
https://www.citrix.com/downloads/citrix-receiver/sdks/virtual-channel-sdk.html
Microsoft also has something similar if you want to use RDP:
http://msdn.microsoft.com/en-us/library/aa383509%28v=vs.85%29.aspx
I'm trying to create a client-server app where the server runs on the user's machine. I'm looking into either using WCF or Sockets but I have a couple of questions.
I'd like to use WCF but it seems that the user needs admin rights in order to launch the service. Would the user need admin rights if the WCF service was running within a managed application (e.g. a Windows Service)? With sockets it seems that admin rights isn't required to open the relevant port.
How would HTTPS security work in WCF? Since this is a LAN program (user talking from client to their own machine), do I need to purchase a certificate and install it on their machines? I'd rather avoid this if possible as the data being transferred isn't sensitive. Would this be the same if I use SSLStream for sockets?
There are a lot of questions, :), so very short answer on part of them:
You can host WCF even in console application. Windows Services may not require admin properties to be installed on pc.
For HTTPS - you does not have to buy certificate, you can crate your own - there are a lot of examples in the net. But - if your data is not sensitive - you can probably use simple http.
I am going to be coding up a windows service to add users to a computer (users with no rights, ie just for authentication). (As a side note, I plan to use this method.)
I want to be able to call this windows service from another computer.
How is this done? Is this a tall order? Would I be better off just creating a Web Service and hosting it in IIS?
I have some WCF services hosted in IIS on the calling computer (they will do the calling to the proposed windows service). I have found that Hosting in IIS is somewhat problematic, so I would rather not have a second IIS instance to manage unless I need to.
(I will be using Visual Studio 2008 SP1, C# and Windows Server 2003 (for both caller and service host).
Thanks for the help
If you are thinking of hosting a web service in IIS just to communicate with an NT-service on that same machine, that is definitely more trouble than it is worth in this case.
As other answers have indicated you can make a WCF service with the operations you need and host that within the same NT-service that you want to interact with. You can easily secure this with certificates, or user accounts to make sure it is only controlled by the right people/machines.
If you need to control the NT-service itself, there are existing programs such as sc.exe to start, stop, configure, or query the status of your NT-service remotely.
However, you may want to consider seeking a solution without the overhead of creating an custom NT-service and a custom WCF service to interact with it. If you do, the Net User commands (sorry no link - new user limitation) or the AddUsers (see kb 199878/en-us) utility may be sufficient. If your remote "controller" can invoke these commands directly against the target machine you may not have to create any custom software address this need. Additionally you would have less software to maintain and administer on the target machine. You would just be using the built-in OS capabilities and admin utilities.
Finally, you will need to think about the security aspect, NT-services and IIS are usually run under very restricted accounts, many auditors would flip-out over any service running with sufficient permission to create or modify users locally, and especially on other machines. You'll want to make sure that the service could never be used to create users that do have more than the "authenticate" permission you indicated.
Edit: The net user command may not work against another machine's local users, but check out. pspasswd that along with PsExec to create users, should do what you need remotely.
Simply host a WCF service in the Windows Service. You'll then be able to call it remotely.
You can host a WCF service inside a Windows service. Take a look at the TCP binding (NetTcpBinding class). Both client and server will have to use WCF, but that doesn't sound like it will be an issue with your implementation.
Also, the section entitled "Hosting in Windows Services" in this MSDN article provides a walk-through of the process
If the windows service publishes a remoting interface then it can be accessed via that remoting interface.
Otherwise it's the same as accessing any other process running on a remote machine except that there may be some tools (e.g., sc) with built in support for executing against a remote machine (barring firewall complications).
Any IPC mechanisms applies; sockets, web services, remoting, etc...
You could expose a WCF service directly from your windows service. When you start up your windows service, in addition to spinning up any other background processes, you could create an instance of ServiceHost<T> for your service implementation. This would allow you to not only provide WCF access, but also avoid the extra instance of IIS like you requested, and provide TCP, Named Pipes, and WsHttp endpoints. This should give you some nice flexibility in the performance tuning arena, since it sounds like this service will be consumed internally on your network, rather than externally.
You could create a WCF service which will talk to your Windows service on the remote box. Host the WCF component in IIS (or however you'd like so that you can communicate with it) and then call the WCF component from your remote machine.