powershell -- script doesn't seem to be using my credentials/permissions

Christian Bahnsen -- .mil account 201 Reputation points
2020-11-30T16:40:56.097+00:00

Issue: When I run a Powershell script it doesn't seem to be using my credentials/profile/permissions. (I'm not running as an administrator.)

Background: I have a Word mailmerge file I want to print one page at a time to a fax server using Powershell. Another post, powershell-printing-from-word-2016-using-the-print.html, figured out how the basics of using Word's .PrintOut() method.

The problem I'm running into is that when Powershell does its thing, the resulting pages are not correctly interpreted/rendered by the fax server.

If I print pages from the mailmerge document using Word manually they render fine.

My hypothesis is that the Powershell script is not using my system credentials when it prints the pages (even though it's running in my user profile).

A code block at the bottom of the document doesn't seem to get interpreted correctly and the fax server rejects the pages.

Is there some way to make sure that when Powershell runs scripts, it runs them as "me" with my credentials/permissions?

Or does Powershell have its own "profile" that runs the script independent of my profile?

Thanks in advance for any assistance.

Christian Bahnsen

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,526 questions
{count} votes

Accepted answer
  1. Christian Bahnsen -- .mil account 201 Reputation points
    2020-12-02T17:01:07.467+00:00

    The issue turned out to be a Word setting that got unchecked when my workstation went through some recent upgrades. Specifically: File | Options | Advanced | Use fonts that are stored on the printer.

    This is such a specialized application ("printing" to a fax server) using an old HP LaserJet driver that using another printer wouldn't have let me zero in on the problem. I remembered this morning that we'd had a similar issue a year or so ago and I dusted off my notes from back then.

    Thanks to @MotoX80 and @Ian Xue for helping me eliminate the credential hypothesis.

    Christian

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ian Xue 37,021 Reputation points Microsoft Vendor
    2020-12-01T09:05:59.673+00:00

    Hi,

    Does the script work if you choose another printer? To run powershell with specified credential you can use Start-Process

    Start-Process powershell -Credential ""  
    

    Best Regards,
    Ian

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.