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

推荐订阅源

I
Intezer
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
N
News | PayPal Newsroom
T
Tenable Blog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
P
Privacy International News Feed
IT之家
IT之家
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
博客园_首页
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
I
InfoQ
D
DataBreaches.Net
有赞技术团队
有赞技术团队
K
Kaspersky official blog
Security Latest
Security Latest
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AI
AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic

博客园 - 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)  评论()    收藏  举报