Powershell 授予 IIS_IUSRS 访问 SMTP 元数据库的权限
Powershell Grant IIS_IUSRS access to SMTP metabase
好的,我正在尝试将手动更改转移到 powershell,
正在尝试授予 IIS_IUSRS 对 IIS 元数据库中 /LM/SmtpSvc/ 和 /LM/SmtpSvc/1/ 节点的访问权限。
我在 google 上进行了大量搜索,但找不到我正在寻找的示例。
我一直在尝试
$smtp = [wmiclass]'root\MicrosoftIISv2:IIsSmtpServerSetting'
但我对 WMI 有点不知所措。
如有任何帮助,我们将不胜感激。需要此设置才能解决
This.
不是一个确切的答案,但是我目前为止最好的答案。按照指南 here 我选择了选项 1 并将应用程序池更改为网络服务。我将继续研究使用 powershell 进行权限设置的方法。
更新(解决方案未经测试)
我从那里找到 this answer on another post that details how to do it using scripts in the iis6.0 resource toolkit. To get these scripts on server 2012 you have to install the IIS6.0 resource toolkit, the only way i can find to do a silent install of this one was located here,您可以使用 cscript.exe 调用脚本。我坚持在应用程序池选项上更改用户,因为它也适合其他内容。
好的,我正在尝试将手动更改转移到 powershell,
正在尝试授予 IIS_IUSRS 对 IIS 元数据库中 /LM/SmtpSvc/ 和 /LM/SmtpSvc/1/ 节点的访问权限。
我在 google 上进行了大量搜索,但找不到我正在寻找的示例。
我一直在尝试
$smtp = [wmiclass]'root\MicrosoftIISv2:IIsSmtpServerSetting'
但我对 WMI 有点不知所措。
如有任何帮助,我们将不胜感激。需要此设置才能解决 This.
不是一个确切的答案,但是我目前为止最好的答案。按照指南 here 我选择了选项 1 并将应用程序池更改为网络服务。我将继续研究使用 powershell 进行权限设置的方法。
更新(解决方案未经测试)
我从那里找到 this answer on another post that details how to do it using scripts in the iis6.0 resource toolkit. To get these scripts on server 2012 you have to install the IIS6.0 resource toolkit, the only way i can find to do a silent install of this one was located here,您可以使用 cscript.exe 调用脚本。我坚持在应用程序池选项上更改用户,因为它也适合其他内容。