我掙扎着這種強烈地和這個職位是如此接近。在嘗試了許多其他的事情之後,我知道這篇文章很貼切,並且認爲我會嘗試一些東西。
有關記錄,在運行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