I'm trying to get all websites from my IIS service, but I need to do it through wmic.
In Powershell, I can do a get-website
and the results are in the format below, that is good enough for my needs, but I can't convet it in a wmic command.
Name ID State Physical Path Bindings
---- -- ----- ------------- --------
Default Web Site 1 Stopped %SystemDrive%\inetpub\wwwroot http *:80:
my.site 2 Started C:\Users\My/Path https 127.0.0.0:443: sslFlags=0
I searched for some options, but anything helped me. Below is my last tries:
wmic service where name = 'W3svc' call get-website
get - Invalid alias verb.
wmic PATH Win32_ServerFeatrure
2 Web Server (IIS) 0
I can get the service, but I can't call any command.
get-wmiobject -query "select * from Win32_Service where name='W3svc'"
Same problem of second option, I can get the service, but can't get any other info.
Backgroud:
I'm using a Linux client for wmic and I need to connect in Windows Server machines to get info about all websites (active or not) configured in the web server.
Are there any way to achieve it using any wmic command or WQL query?