iisvdir /query doesn't return vdirs

32bit - Win2k3 IIS6 running command 'iisvdir /query w3svc/1' returns all of the virtual directories under the root.

On another 32bit - Win2k3 IIS6 command 'iisvdir /query w3svc/1' returns "No virtual sub-directories available."

Both servers have virtual sub directories, but the 2nd server isn't listing them with the iisvdir.  Any ideas?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


permissions maybe?

Try defining interactive user when running the script:

/u [Domain\]User /p Password


iisvdir /u SERVER\Administrator /p adminpass /query w3svc/1

cheers,  Mike.
LrdKanienAuthor Commented:
ran specifying local adminstrator and same results.
Maybe the default web site has a different number than '1'

try adsutil.vbs to see what the web site IDs are, eg:

c:\inetpub\adminscripts\adsutil.vbs ENUM /P W3SVC


the result set shows that there is a web site ID 1 as well as ID 1174731628

enumerate the subfolders of that web site by:

c:\inetpub\adminscripts\adsutil.vbs ENUM /P W3SVC/1174731628


Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

LrdKanienAuthor Commented:
I can use adsutil /enum w3svc/1/root and it will list the vdirs, however iisvdir doesn't.  Also if I try to specify as you have done above it shows as:

C:\Inetpub\AdminScripts>adsutil.vbs ENUM /P W3SVC/[/W3SVC/1]

The path requested could not be found.
ErrNumber: -2147024893 (0x80070003)
Error Trying To ENUM the Object (GetObject Failed): W3SVC/[/W3SVC/1]

Yes the default site has ID1.  I cannot figure out why iisvdir works on one server and not another.

C:\Inetpub\AdminScripts>iisvdir /query w3svc/1
Connecting to server ...Done.
No virtual sub-directories available.

c:\inetpub\adminscripts\adsutil.vbs ENUM /P W3SVC/1/root
[/W3SVC/1002649854] and so on...

>> C:\Inetpub\AdminScripts>adsutil.vbs ENUM /P W3SVC/[/W3SVC/1]

in my examples above, these parts:


are supposed to be the script output result - not intended as input data.

so just enter this:

C:\Inetpub\AdminScripts>adsutil.vbs ENUM /P W3SVC/


C:\Inetpub\AdminScripts>adsutil.vbs ENUM /P W3SVC/1

C:\Inetpub\AdminScripts>adsutil.vbs ENUM /P W3SVC/Root

etc etc.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LrdKanienAuthor Commented:
even the boys at M$ had no clue.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.