我挣扎着这种强烈地和这个职位是如此接近。在尝试了许多其他的事情之后,我知道这篇文章很贴切,并且认为我会尝试一些东西。
有关记录,在运行Windows Server 2008 R2和Excel 2013自动化时,systemprofile中的“Desktop”文件夹修复了此问题。这只是我们升级到Windows Server 2012 R2和Excel 2016之后才出现的一个问题。为了消除Excel作为罪魁祸首,我尝试了使用Windows Server 2012 R2和Excel 2013的服务器,并且遇到了非常类似的问题。
网络服务下的所有自动化工作都很好,但理想情况下,我们想要在ApplicationPoolIdentity下运行我们的网站。
首先,ApplicationPoolIdentity运行的应用程序池需要加载用户配置文件。
Start Run -> inetmgr
expand Server -> Application Pools
right click on your App Pool -> Advanced Settings
under Process Model -> Load User Profile <-- should be set to true
所以现在我必须弄清楚这个身份是谁。也许有更好的方法来做到这一点,但因为我将用户添加到IIS_IUSRS,所以这是我找到信息的地方。现在
Windows -> Edit local users and groups
Groups -> right click IIS_IUSRS -> Add to Group...
Add...
Locations... (choose local server), click OK
In the Enter the object names to select box type IIS APPPOOL\<app pool name>
(note the space and the triple P)
also, <app pool name> is the name of your Application Pool in inetmgr
你应该看到作为IIS_IUSRS IIS APPPOOL \会员(SID)其中SID是在Windows中的applicationpoolidentity安全标识符。这将是一个非常长的字母数字短划线,如“S-1-5 - ## - ######### - ######### - ######## ## - ######### - #########“
与上面的答案不同,这是我需要在注册表中编辑的用户。
因此,现在继上面的答案我不得不将以下添加到注册表。注意:向S-1-5-18添加密钥并不能解决问题,我不得不将它们添加到上面找到的ApplicationPoolIdentity的SID中。
[HKU]\SID\Software\Microsoft\Windows NT\CurrentVersion\Devices
"Send To OneNote 2010"="winspool,nul:"
"Microsoft XPS Document Writer"="winspool,Ne00:"
[HKU]\SID\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts
"Send To OneNote 2010"="winspool,nul:,15,45"
"Microsoft XPS Document Writer"="winspool,Ne00:,15,45"
[HKU]\SID\Software\Microsoft\Windows NT\CurrentVersion\Windows
"UserSelectedDefault"=dword:00000000
"Device"="Microsoft XPS Document Writer,winspool,Ne00:"
请注意,我是如何使用eletre/Robert的“正确”响应。使用Device的OneNote选项对我无效。
希望这可以节省某人在某一天狩猎这种麻烦的麻烦。
您在服务设置 - >登录选项卡“允许服务与桌面交互”中签入? – 2010-12-10 12:11:28
是的,这是检查。 – 2010-12-10 12:31:53