Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script IIS Config

Status
Not open for further replies.

djtech2k

MIS
Jul 24, 2003
1,097
US
I need to write some vbscript to change some IIS config. I have some IIS boxes that have a web directory that point to a share. In doing this, they have a "connect as" user/password for the connection. I need to script this change. I suspect its in a WMI class, but am not sure which if it does exist. Anyone have any code to do this or something very similar?

I wanted to search theses forums first, but the search is still down on this site.
 
I have looked at the MS site, but no luck. I do not see anything on the other site as well.
 
I found that the settings for the "connect as" are stored in the IISWebVirtualDirectorySetting class.

Now, I just need to try to write the information back to WMI to store it. With this class, can it be done with something like:

"beforesetting = aftersetting"


I know in some things, there is a function of something like:

"something.change"

Does that apply here?
 
I don't see the class IISWebVirtualDirectorySetting or the property you're referring to, but you might try something like:

objItem.Property = "new setting"
objItem.Put_

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
I just put the scriptomaticv2 on a server with IIS installed and it is one of the last classes on the end of the list under "root\microsoftiisv2".
 
So my question still stands. If I am able to query the value that I need in WMI, how do I change the WMI value?

Should it be something like:

value = "my value here"

or something like:

value.update

I am not sure how to change this WMI value setting.
 
You need to look at the METHODS in WMI. Scriptomatic 2 has a tab for the methods or use WBEMTEST or CIMStudio to see the methods available.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top