Thanks. But this not work for me. Many of our extsing laptops are newly installed. Our users has no default printer set on their computer. If they have a default printer on laptop, then my script will work without issue to change it to a new default laptop.
Powershell scripts to set up default printer
Hi,
I want to set up default printer for all the users in the company. I can run the scripts without error. However, The default printer can't be set successfully. I tried many ways to do it without success but no error. I found that if the computer has no default printer set before, then the scripts will not work. If it has a default printer, the the script is successful to set it as default. The following is the scripts, please help.
$ArrPrint = Get-Printer -Name "My printer"
Foreach ($Printer in $ArrPrint){
(Get-WMIObject -ClassName win32_printer | Where-Object -Property Name -eq $($Printer.name)).SetDefaultPrinter() | Out-Null
}
3 answers
Sort by: Most helpful
-
-
Limitless Technology 39,351 Reputation points
2022-01-06T14:53:59.373+00:00 Hello @Kevin Arc
I can recommend to set up a GPO to define first a default printer at first logon into the machines then you would be able to workaround the "empty" default printer issue.
There is a previous post with different suggestions on how to follow the process: https://social.technet.microsoft.com/Forums/security/en-US/56a2b844-77b9-4935-9932-b226264f129b/set-default-printer-for-all-users-domain-pc?forum=win10itprogeneral
Hope this helps with your query,
-----------
--If the reply is helpful, please Upvote and Accept as answer--
-
Limitless Technology 39,351 Reputation points
2022-01-06T14:53:59.713+00:00 Hello @Kevin Arc
I can recommend to set up a GPO to define first a default printer at first logon into the machines then you would be able to workaround the "empty" default printer issue.
There is a previous post with different suggestions on how to follow the process: https://social.technet.microsoft.com/Forums/security/en-US/56a2b844-77b9-4935-9932-b226264f129b/set-default-printer-for-all-users-domain-pc?forum=win10itprogeneral
Hope this helps with your query,
-----------
--If the reply is helpful, please Upvote and Accept as answer--