PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,526 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to set Paper Source to Tray 1 to print A4 in with powershell script but seems like I cannot find any method for it.
Can we do it with Set-PrintConfiguration
method?
Hello there,
Here is how to change the set paper source in the settings object:
PS C:\scripts> $settings = [System.Drawing.Printing.PrinterSettings]::new()
PS C:\scripts> $settings.DefaultPageSettings.PaperSource
Kind RawKind SourceName
---- ------- ----------
AutomaticFeed 7 Auto Select
PS C:\scripts> $settings.PaperSources
Kind RawKind SourceName
---- ------- ----------
AutomaticFeed 7 Auto Select
Manual 4 Manual Feed
Upper 1 Tray 1
Middle 3 Tray 2
Lower 2 Tray 3
PS C:\scripts> $settings.DefaultPageSettings.PaperSource = $settings.PaperSources[2]
PS C:\scripts> $settings.DefaultPageSettings.PaperSource
Kind RawKind SourceName
---- ------- ----------
Upper 1 Tray 1
PS C:\scripts>
Similar discussion here https://social.technet.microsoft.com/Forums/en-US/1394962d-d195-4847-9df8-27059b81473b/powershell-setting-papersourcetray-for-a-printer?forum=ITCG
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer--