This article is a mirror article of machine translation, please click here to jump to the original article.

View: 28164|Reply: 6

[Source] .net/c# operations for iiS6, 7 [source code]

[Copy link]
Posted on 8/7/2017 4:05:45 PM | | |
Encapsulation is suitable for use as an internal tool in projects that need to operate IIS in the installer, such as building a website and building a virtual directory

Basic Form Form:
iisutil.exe Command / Argument 1: Value 1 / Parameter 2: Value 2


The return value of the process is the running result, 0 indicates success, and the other values indicate error, see the error code below


===========================================

1. Create a site
        iisutil CreateSite /siteName:Rvsp /httpPort:80 /httpsPort:445 /physicalPath:C:\wwwroot /sslHash:5681154ac76ef9b73af44b08e4730933c633b26b

        Parameters:
                siteName: The site name, required
                httpPort: Port, required under IIS6, not required in IIS7
                httpsPort: ssl port, not required
                physicalPath: Physical path, required
                sslHash: The certificate hash is required when httpsPort is specified, and the certificate must be placed in the personal area of the LocalMachine


----------------------
2. Delete the site
        iisutil RemoveSite /siteName:Rvsp

        Parameters:
                siteName: The site name, required


----------------------
3. Create an application pool
        iisutil CreateAppPool /poolName:RvspPool

        Parameters:
                poolName: The pool name, required


----------------------
4. Delete the application pool
        iisutil RemoveAppPool /poolName:RvspPool

        Parameters:
                poolName: The pool name, required


----------------------
5. Create a virtual directory
        iisutil CreateDir /siteName:Rvsp /virtualPath:/log /physicalPath:C:\wwwroot\log /enableAllMimeTypes:true

        Parameters:
                siteName: The site name, required
                virtualPath: The virtual path, starting with /, currently only supports one level, required
                physicalPath: Physical path, required
                enableAllMimeTypes: Optional to allow downloading of arbitrary files


----------------------
6. Delete the virtual directory
        iisutil RemoveDir /siteName:Rvsp /virtualPath:/log

        Parameters:
                siteName: The site name, required
                virtualPath: The virtual path, required


----------------------
7. Create an application
        iisutil CreateApp /siteName:Rvsp /virtualPath:/log /physicalPath:C:\wwwroot\log /poolName:RvspPool /useSsl:true

        Parameters:
                siteName: The site name, required
                virtualPath: The virtual path, starting with /, currently only supports one level, required
                physicalPath: Physical path, required
                poolName: The name of the application pool, required
                useSsl: whether to require ssl, not required


----------------------
8. Delete the application
        iisutil RemoveApp /siteName:Rvsp /virtualPath:/log /physicalPath:C:\wwwroot\log /poolName:RvspPool /useSsl:true

        Parameters:
                siteName: The site name, required
                virtualPath: The virtual path, required


----------------------
9. Determine whether the site exists
        iisutil SiteExist /siteName:Rvsp

        Parameters:
                siteName: The site name, required
        Return value:
                400 does not exist
                503 exists


----------------------
10. Replace the site SSL certificate
        iisutil SetCert /siteName:Rvsp /sslHash:5681154ac76ef9b73af44b08e4730933c633b26b

        Parameters:
                siteName: The site name, required
                sslHash: Certificate hash, required, the certificate to be placed in the personal area of the LocalMachine


----------------------
11. Replace the site port
        iisutil SetPort /siteName:Rvsp /httpPort:8080 /httpsPort:8081

        Parameters:
                siteName: The site name, required
                httpPort: Port
                httpsPort: ssl port


===========================================


Error Code:

        302: Incorrect parameter
        400: Site not found
        401: Application pool not found
        402: Application not found
        403: Root app not found
        404: Virtual directory not found
        500: IIS version unknown
        501: http port is occupied
        502: The https port is occupied
        503: The site already exists
        504: Application pool exists
        505: The application already exists
        506: The virtual directory already exists
        909: Unknown error


Interface:



IIS6 implementation:



IIS7 implementation:



Source code download:

Tourists, if you want to see the hidden content of this post, pleaseReply





Previous:Radish Home GHOST System X86/X64 Ultimate Edition 2017
Next:【Founding the Great Cause】New Radish Home Ghost Windows7 32&64 Computer City Installed v201708+
Posted on 8/7/2017 5:24:13 PM |
Yes, thanks for sharing
Posted on 12/14/2017 3:18:15 PM |
Just need to download it and try it
Posted on 12/28/2017 12:57:21 PM |
Posted on 12/29/2017 2:59:22 PM |
Support the landlord, take a look  
Posted on 5/21/2018 2:00:17 PM |
Learn it
Posted on 1/13/2019 6:22:04 PM |
Dear, looking for this, try it, thank you
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com