惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
IT之家
IT之家
Google DeepMind News
Google DeepMind News
D
Docker
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 【当耐特】
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
博客园 - Franky
月光博客
月光博客
宝玉的分享
宝玉的分享
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - stefanie

SQL - 获取多机构最近相同节点 PowerShell-将CSV导入SQL Server VBS 操作注册表 十六进制 无法在People Picker中选择用户 Microsoft Certification List WINDOWS 2012忘记密码之后。。。 Auto Install Workflow Manager 1.0 批量删除Kindle Personal Documents 导入Excel表格到SharePoint站点 用户中心 - 博客园 [Powershell] FTP Download File [PowerShell] Backup Folder and Files Across Network SSRS 请求并显示SharePoint人员和组字段 VS 2010 安装 .net framework2.0/3.0/3.5 How to Setup AssociatedOwnerGroup / AssociatedMemberGroup / AssociatedVisitorGroup RPC服务不可用 [转]SharePoint Versions 安装 64 位版本的 Office 2010 后,无法查看数据表视图中的列表 [MOSS]关闭弹出窗口
[Powershell] 检查IIS设置
stefanie · 2016-03-25 · via 博客园 - stefanie
$script:OutMessage = "ok"


function WriteLog([string]  $content){

    #Write-Host $content
    $script:OutMessage += $content + "`r`n"
}

Import-Module WebAdministration

#获取所有Application Pools

WriteLog "开始检查IIS应用程序池..."
Get-ChildItem IIS:\apppools | ForEach-Object{
    $appPoolName =  $_.Name
    WriteLog("开始检查应用程序池: " + $_.name)

    $appPool = $_

    #检查回收设置
    $RecyclingTime = $appPool.recycling.periodicRestart.time.TotalMinutes
    WriteLog ("--自动回收周期(Minutes):" + $RecyclingTime)

    #检查账号设置
    $identityType = $appPool.processModel.identityType
    WriteLog("--账号类型:" + $identityType)

    $userName = $appPool.processModel.userName
    WriteLog("--用户:" + $userName)
    #$password = $appPool.processModel.password

    #生成回收事件日志设置
    $LogEventOnRecycle = $appPool.recycling.logEventOnRecycle
    WriteLog("--LogEventOnRecycle:"+ $LogEventOnRecycle)

    #把Idle Timeout设为0
    $IdleTimeout = $appPool.processModel.idleTimeout
    WriteLog("--IdleTimeout:"+ $IdleTimeout)

    #最大工作进程数设置为0,支持NUMA
    $maxProcesses = $appPool.processModel.maxProcesses
    WriteLog("--maxProcesses:"+ $maxProcesses)

    WriteLog (" ")
}


WriteLog "开始检查IIS网站..."
Get-ChildItem IIS:\Sites | ForEach-Object{
    $site = $_
    WriteLog ("开始检查站点: " + $site.name)

    #检查网站日志目录
    WriteLog ("--是否开启IISLOG:" + $site.logFile.enabled)
    WriteLog ("--日志字段:" + $site.logFile.logExtFileFlags)
    WriteLog ("--日志存放路径:" + $site.logFile.directory)
    WriteLog ("--日志文件大小:" + $site.logFile.truncateSize)
    WriteLog (" ")
}

$OutMessage

posted @ 2016-03-25 17:25  stefanie  阅读(2126)  评论()    收藏  举报