Just loop through all the props out output the name.
Just loop through all the props out output the name.
I'm a little new to VB.NET.
The properties collection is of type PropertyCollection.
What's the type of each of the elements (the one to use in the for each loop)?
I think this will give you what you need.
Thanks for the code. It was exactly what I was looking for.
i dopied source code for creating virtual directory in IIS of local server . but if i want to Create in IIS of another PC using IP adderess ,what should i change in that code??? anyone plssss i m new user ...
Instead of LocalHost pass the IP address.
hi,i can create virtual directory in IIS .but i want to create a New website i.e.www.testing.com. how can i create using vb.net any idea plz plz tell me.....
thanx in Advance
Take a look at:
i want ur suggestion.
what should i use in my project .
MYSQL or microsoft's SQL server as backend in .NET????
if i want to use MYSQL as backend which technology should i prefer?
apache/PHP or .NET??
I would have to always say IIS, .NET and MS SQL Svr.
...then again...it completely depends on what project you are writting. MS SQL Svr my be complete overkill for very very small projects.
i m creating job searching website.
jobseekers can resume their CV,search for vaccancies..etc..etc..
it is very big Project..
if i use My SQL as a backend ,will it create any problem(i.e.like speed slow,efficiency etc.)??
i don't want to use MS SQL Server as a backend.
I am not that familiar with My SQL I am afraid.
Why don't you want to use SQL Svr?
i m working on the project as per the client requirement. my client wants to use my sql as a backend. do u have any idea plssss??
Ideas on what?
If your client wants My SQL then use My SQL...I wudn't. I would use SQL Svr...MSDE 2000 or MSDE 2005 Express.
My SQL won't cause you any issues I don't think, it's just not as good as SQL Server.
You want to be asking these kind of questions in the DB section...you'll get a bigger response.
I'm new to this site and registered purely on the back of this excellent piece of work to create virtual directories in VB.NET.
But, I'm having a problem with the RPC issue.
I can't just turn the firewall off (company policy I'm afraid! :ehh: ).
Is there any further developments with getting round this RPC issue? Are there any exceptions I should set within Windows Firewall to allow this IIS change from the application I've created?
For further information, the error I receive is this:-
System.Runtime.InteropServices.COMExeption occured in system.directoryservices.dll
Additional information: The RPC server is unavailable.
This occurs on the following line within the code:
Dim CanCreate as Boolean = Not IISSchema.Properties("Syntax").Value.ToString.ToUpper() = "Boolean"
Any help would be really appreciated!
Hi and welcome :wave:
This is a tricky one. It can be caused by many many things. Firewalls just being one of them
Does your company use a 3rd party firewall? If so, turning off the windows firewall may fix the issue.
Not exactly sure what ports need to be open I am afraid :(
If you run this on the web server itself do you get the errors?
I'm not sure exactly how their firewall is set up. It's quite a big company (British Telecom!!! lol).
I'm writing a system to automate the installation of a web application we have developed. Part of the automation is to manipulate IIS and create the virtual directories.
The script has been ran from the web server itself (i.e. localhost) but still this RPC error is returned.
I will do some investigating myself and if I find a solution I'll post it. I'm not holding my breath though! :rolleyes:
hehe. BT. I was working there not so long ago and they have some of the most locked down environments I have ever seen.
Have you heard of HMC, Hosted Message Collaboration? or MPS, Microsoft Provisioning System?
I did some overview dev training on these products for BT a few months ago.
MPS was designed to provision resources in your environment...any resources.
Have a word with ppl at BT and see if they have heard of HMC....if so, use that :D
So, you also got the error on the local IIS box? :( doesn't sound good.
Does the local IIS box have windows firewall running?
In order for the App Name to be populated correctly, you have to swap these two lines
If you don't swap the two lines, the AppFriendlyName will appear blank when you look at the properties of your Virtual Directoy.
Other than that, excellent code. Thanks
Good bug spot. Thanks :D
I only registered to this site to say thank you for the post. Two years later and it's still working and helping people like me. Thank you to all of you. I rewrite the code in c# but for some reason I couldn't figure out it's not working. So I decided to write it in VB.Net and use it as a DLL, which is working perfectly. Weird isn't it?
I was wondering if anyone knows how to add an IIS 6 web site with Host Header?
Hi Woka! Thanks for letting us use the code I really appreciate it. The code seemed to be working when I was running it through visual studios, but after we uploaded onto the server I am getting the RPC unavailable error. I'm not sure what to do to fix this, we checked the firewall and are logging in as administrator so I'm not sure what else can be the problem. Do you have any ideas? Here is the stack trace error that follows:
[COMException (0x800706ba): The RPC server is unavailable.
System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +377678
System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) +49
System.DirectoryServices.PropertyCollection.get_Item(String propertyName) +150
MFC.WebApp.SecureAuth.WebAdminWorkflow.CreateVirtualDir(String WebSite, String AppName, String Path) +192
MFC.WebApp.SecureAuth.WebAdminWorkflow.AddInstanceButton_Click(Object sender, EventArgs e) +239
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Nevermind I found what was wrong. I was hardcoding the name for my box while I was coding instead of putting the localhost name. Everything seems to be working fine now
I dont know how old is this post. the code you wrote is great and works for me like charm the only problem is that i want to add the physical path credentials to the virtual directory with your code but i couldnt find anywhere what property should i use.