L
L
L0ns2021-12-08 16:40:40
PowerShell
L0ns, 2021-12-08 16:40:40

How to change the print server for a network printer?

The task is as follows, it is necessary to change the address of the print server through which printing is performed on the users' PC, without deleting the printers. I thought to do it through PowerShell, but I don't understand how to change the registry setting in the "HKEY_CURRENT_USER\Printers\Connections\,,PrintServer,Printer" Server branch.

Get-ChildItem -path ‘HKCU:\Printers\Connections’ -recurse -ErrorAction SilentlyContinue

Perhaps someone will tell you how to change the print server differently, for example, using the Get-Printer cmdlet

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
MaxKozlov, 2021-12-08
@MaxKozlov

in addition to Get-Printer , there is Set-Printer and much more

PS> Get-Command -Module PrintManagement
Add-Printer
Add-PrinterDriver
Add-PrinterPort
Get-PrintConfiguration
Get-Printer
Get-PrinterDriver
Get-PrinterPort
Get-PrinterProperty
Get-PrintJob
Read-PrinterNfcTag
Remove-Printer
Remove-PrinterDriver
Remove-PrinterPort
Remove-PrintJob
Rename-Printer
Restart-PrintJob
Resume-PrintJob
Set-PrintConfiguration
Set-Printer
Set-PrinterProperty
Suspend-PrintJob
Write-PrinterNfcTag

E
Evgeniy Odinets, 2015-06-09
@eucalipt

$arr = array(
    'title' => 'This is Title',
    'content' => 'This is Content'
);

$new_arr = array();
foreach($arr as $key => $value){
  $new_arr['{{'.$key.'}}'] = $value;
}

print_r($new_arr);

M
Michael Lyamin, 2015-06-09
@BusteR27

And you can get a little twisted :)

function bracket($n) {
  return '{{'.$n.'}}';
}
$new = array_flip(array_map("bracket", array_flip($old)));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question