MSDN Documentation here:
MSDN AdsUtil.vbs

According to this TechNet article, you should be able to view, create and delete Virtual Directories in the IIS7 GUI admin tool, but I had difficulties with it.

AdsUtil can be found here: c:inetpubAdminScripts
(on machines running Windows 2008 and IIS7).
It’s a VB/Script (.vbs suffix) and you should always run it with CSCRIPT (the command prompt version of VBScript that causes all output to write to the console rather than popping up message boxes).

Why am I documenting this? I had a case using the BizTalk Deployment Framework (BTDF) from CodePlex where I had deleted a Virtual Application in IIS, but apparently a Virtual Directory was still remaining. When I ran the BTDF deploy function, it told me that the virtual directory already existed. I had to resort to some method of manually deleting it. In theory, with IIS7, we should be able to use APPCMD in c:inetpubAdminScripts, but I had some situations where ADSUTIL showed the VDIR and APPCMD did not.

Testing a Path with ADSUTIL

<code>
c:inetpubAdminScripts>cscript adsutil.vbs ENUM /W3SVC/1/ROOT/TFBIC.RCT.BizTalk
.Orchestrations
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All  rights reserved. 

KeyType                         : (STRING) "IIsWebVirtualDir"
AppRoot                         : (STRING) "/LM/W3SVC/1/ROOT/TFBIC.RCT.BizTalk.O
rchestrations"
AppFriendlyName                 : (STRING) "TFBIC.RCT.BizTalk.Orchestrations"
AppIsolated                     : (INTEGER) 0
Path                            : (STRING) "C:inetpubwwwrootTFBIC.RCT.BizTalk
.Orchestrations"
AuthFlags                       : (INTEGER) 1
AuthBasic                       : (BOOLEAN) False
AuthAnonymous                   : (BOOLEAN) True
AuthNTLM                        : (BOOLEAN) False
AuthMD5                         : (BOOLEAN) False
AuthPassport                    : (BOOLEAN) False
AppPoolId                       : (STRING) "DefaultAppPool"
NTAuthenticationProviders       : (STRING) "Negotiate,NTLM"
</code>

Delete a Virtual Directory with ADSUTIL

<code>
c:inetpubAdminScripts>cscript adsutil.vbs DELETE /W3SVC/1/ROOT/TFBIC.RCT.BizTa
lk.Orchestrations
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

deleted path W3SVC/1/ROOT/TFBIC.RCT.BizTalk.Orchestrations"
</code>

Tagged with:

Filed under: Uncategorized