All,
I am looking for a simple script to remap domain printers. i need to
determine what printers from server ABC are installed and replace them with
identical printers from server XYZ. Can this be done easily? and can
anybody point me in the right direction?

many thanks.

Re: printer changes by Torgeir

Torgeir
Tue Mar 15 07:15:13 CST 2005

richb330 wrote:

> All,
> I am looking for a simple script to remap domain printers. i need to
> determine what printers from server ABC are installed and replace them with
> identical printers from server XYZ. Can this be done easily? and can
> anybody point me in the right direction?
Hi

E.g. see the MovePrinters sub here:

http://groups.google.co.uk/groups?selm=eSS0Z%23C9EHA.2316%40TK2MSFTNGP15.phx.gbl


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: printer changes by richb330

richb330
Tue Mar 15 11:07:51 CST 2005

many thanks. that worked a treat.

do you know of a similar script that will work for network shares?

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:%23uNuoEWKFHA.2132@TK2MSFTNGP14.phx.gbl...
> richb330 wrote:
>
>> All,
>> I am looking for a simple script to remap domain printers. i need to
>> determine what printers from server ABC are installed and replace them
>> with
>> identical printers from server XYZ. Can this be done easily? and can
>> anybody point me in the right direction?
> Hi
>
> E.g. see the MovePrinters sub here:
>
> http://groups.google.co.uk/groups?selm=eSS0Z%23C9EHA.2316%40TK2MSFTNGP15.phx.gbl
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx



Re: printer changes by Hasan

Hasan
Thu Mar 17 02:47:56 CST 2005

Hi,
For network shares, you can export the registry key from one server
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares"
and import it on other server. But it requires restart.

Hasan Çolpan

"richb330" <richb999@hotmail.com> wrote in message
news:113dmecek38mm38@corp.supernews.com...
> All,
> I am looking for a simple script to remap domain printers. i need to
> determine what printers from server ABC are installed and replace them
> with identical printers from server XYZ. Can this be done easily? and
> can anybody point me in the right direction?
>
> many thanks.
>



Re: printer changes by richb330

richb330
Thu Mar 17 10:20:54 CST 2005

many thanks. I'll give that a go. Going back to the printer script, it
worked great in a test environment but when i put it leave via logon script
in a gpo it fails on some users stating that 'The network share cannot be
found' at:
WshNetwork.RemovePrinterConnection PrinterPath, True, True

at Ln 40 character 8

This seems to be intermittent and not for every user who logs on. I have
checked the script host version on the pcs and they are all the same. any
ideas what could be causing this?

"Hasan Çolpan" <hcolpan@hotmail.com> wrote in message
news:u8egW2sKFHA.572@tk2msftngp13.phx.gbl...
> Hi,
> For network shares, you can export the registry key from one server
> "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares"
> and import it on other server. But it requires restart.
>
> Hasan Çolpan
>
> "richb330" <richb999@hotmail.com> wrote in message
> news:113dmecek38mm38@corp.supernews.com...
>> All,
>> I am looking for a simple script to remap domain printers. i need to
>> determine what printers from server ABC are installed and replace them
>> with identical printers from server XYZ. Can this be done easily? and
>> can anybody point me in the right direction?
>>
>> many thanks.
>>
>
>



Re: printer changes by Torgeir

Torgeir
Thu Mar 17 13:14:27 CST 2005

richb330 wrote:

> many thanks. I'll give that a go. Going back to the printer script, it
> worked great in a test environment but when i put it leave via logon script
> in a gpo it fails on some users stating that 'The network share cannot be
> found' at:
> WshNetwork.RemovePrinterConnection PrinterPath, True, True
>
> at Ln 40 character 8
>
> This seems to be intermittent and not for every user who logs on. I have
> checked the script host version on the pcs and they are all the same. any
> ideas what could be causing this?
Hi

I don't know about the cause, but to suppress the error, try this:

Instead of

If StrComp(ServerName(PrinterPath), OldServer, 1) = 0 Then
WshNetwork.RemovePrinterConnection PrinterPath, True, True
On Error Resume next

use this:

If StrComp(ServerName(PrinterPath), OldServer, 1) = 0 Then
On Error Resume next
WshNetwork.RemovePrinterConnection PrinterPath, True, True


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx