adric: (Hacker)
adric ([personal profile] adric) wrote2007-10-05 04:58 pm

Success?! (Yes, more Windows Scripting crap)


PS C:\Users\Administrator> Get-WmiObject -namespace "root/WebAdministration" -query "select * from VirtualDirectory" | Select-Object SiteName,PhysicalPath

SiteName PhysicalPath
-------- ------------
Default Web Site %SystemDrive%\inetpub\wwwroot
Default Web Site C:\Perl\eg\PerlEx
longhorn C:\inetpub\wwwroot



Or, with the DotNet assemblies (libraries) loaded in ...
PS C:\scripts> $sm = ( New-Object Microsoft.Web.Administration.ServerManager )
PS C:\scripts> $sm.Sites | Select Id, Name

 Id Name
 -- ----
  1 Default Web Site
  2 longhorn

ala: http://blogs.iis.net/tobintitus/archive/2006/11/30/powershell-and-microsoft-web-administration.aspx

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org