惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
C
Cybersecurity and Infrastructure Security Agency CISA
T
Troy Hunt's Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
AI
AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 热门话题
W
WeLiveSecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Cisco Blogs
S
Security Affairs
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
Security Latest
Security Latest
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google DeepMind News
Google DeepMind News
博客园_首页
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
T
The Blog of Author Tim Ferriss
Recent Commits to openclaw:main
Recent Commits to openclaw:main
阮一峰的网络日志
阮一峰的网络日志
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Threat Research - Cisco Blogs
P
Privacy International News Feed
I
Intezer
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
K
Kaspersky official blog
S
Schneier on Security
云风的 BLOG
云风的 BLOG
有赞技术团队
有赞技术团队
爱范儿
爱范儿
博客园 - 叶小钗
博客园 - Franky
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Cloudbric
Cloudbric
V
V2EX
大猫的无限游戏
大猫的无限游戏
Scott Helme
Scott Helme
H
Hacker News: Front Page
SecWiki News
SecWiki News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】

博客园 - dahai.net

常用的DOCUMENT.EXECCOMMAND WebForm中的tip - dahai.net - 博客园 修改所有用户表/存储过程/视图/触发器/自定义函数的所有者为dbo,则用游标(不要理会错误提示) 在无锡办理10万元注册资本的企业,所需要时间和费用 Win 2003下无敌权限提升方法(转) ftp讨论站连接 使用.NET实现断点续传 千万数据翻页解决方案 CHM格式解析 从互联网加载图片到PictureBox1 Visual Studio .NET已检测到指定的Web服务器运行的不是ASP.NET 1.1 版 - dahai.net [分享]千万数量级分页存储过程(带效果演示)(转) 网站分析专用名词 列出sqlserver数据库孤立用户 写数据到文件 - dahai.net - 博客园 网页模糊归类算法的应用与实现 搜索引擎的实现原理 总结字符串编码(转) 一种快速的未登陆词识别方法(原理和实现)
使用WMI创建站点和虚拟目录,并设置属性 - dahai.net - 博客园
dahai.net · 2006-05-09 · via 博客园 - dahai.net

' Make connections to WMI, to the IIS namespace on MyMachine, and to the Web service.
set locatorObj = CreateObject("WbemScripting.SWbemLocator")
set providerObj = locatorObj.ConnectServer("MyMachine", "root/MicrosoftIISv2")
set serviceObj = providerObj.Get("IIsWebService='W3SVC'")
 
' Build binding object, which is a required parameter of the CreateNewSite method.
' Use the SpawnInstance WMI method since we are creating a new instance of an object.
Bindings = Array(0)
Set Bindings(0) = providerObj.get("ServerBinding").SpawnInstance_()
Bindings(0).IP = ""
Bindings(0).Port = "8383"
Bindings(0).Hostname = ""
 
' Create the new Web site using the CreateNewSite method of the IIsWebService object.
Dim strSiteObjPath
strSiteObjPath = serviceObj.CreateNewSite("MyNewSite", Bindings, "C:\Inetpub\Wwwroot")
If Err Then
WScript.Echo "*** Error Creating Site: " & Hex(Err.Number) & ": " & Err.Description & " ***"
WScript.Quit(1)
End If
 
' strSiteObjPath is in the format of IIsWebServer='W3SVC/1180970907'
' To parse out the absolute path, W3SVC/1180970907, use the SWbemObjectPath WMI object.
Set objPath = CreateObject("WbemScripting.SWbemObjectPath")
objPath.Path = strSiteObjPath
strSitePath = objPath.Keys.Item("")
 
' Set some properties on the root virtual directory which was created by CreateNewSite.
Set vdirObj = providerObj.Get("IIsWebVirtualDirSetting='" & strSitePath & "/ROOT'")
vdirObj.AuthFlags = 5 ' AuthNTLM + AuthAnonymous
vdirObj.EnableDefaultDoc = True
vdirObj.DirBrowseFlags = &H4000003E ' date, time, size, extension, longdate
vdirObj.AccessFlags = 513 ' read, script
vdirObj.AppFriendlyName = "Root Application"
 
' Save the new settings to the metabase
vdirObj.Put_()
 
' CreateNewSite does not start the server, so start it now.
Set serverObj = providerObj.Get(strSiteObjPath)
serverObj.Start
 
WScript.Echo "A New site called MyNewSite was created with the path and unique site identification number of " & strSitePath

posted on 2006-05-09 20:05  dahai.net  阅读(489)  评论()    收藏  举报