URG: Creating a folder on a remote machine (WMI, ADSI, FSO etc)
Posted on 2004-04-14
Hi very urgent question.
I have a windows service that needs to create a folder on a remote machine. Then I need to share it and set security permissions on the share.
I am using c# for my win service. I know that setting share permissions and creating a share can be done using WMI. However I have not tried to implement it yet. Any help on this, especially code examples will be much appreciated.
However more urgent is creating a directory. I heard from someone that it can be done using WMI too. The problem is I can't find any examples or any information on this on the net and I spent good few hours if not more. WMI is the ideal solution for me, as I will later be using it for creating the share and iis website etc. One platform for all is good, plus its a preffered one in the company. Any help with code examples on this and you will be my personal God :).
I have options of creating a slave windows service and install it on all the remote servers. However this is ugly and probably the least preferred method. Another option is creating a share on the machine and then using some user account to impersonate in .NET. But I don't want to go that way either. Any other ideas and options will be good. For example can FSO (FileSystemObject) be used over network? Or any other way?
I am new to WMI and pretty new to c#, although i know my way around it pretty well by now (c# that is :)). So any examples on WMI will be great. If not any info, even link will be appreciated!!! It is very urgent for me, as this is holding my project back and I am not meeting the schedule :S.
I will give all the points for a very good answer on creating share. If this is not answered then i will give full points for an answer to the share problem with examples. If there are good answers from several people on any topic, I will fairly split the points...
Thanks in advance,