OVH Cloud OVH Cloud

installe printer via script

2 réponses
Avatar
Eric
Salut

Windows 2003 sp1

J'aimerais installer mais imprimanter qui sont en share sur mon serveur via
un script dans le GPO. Mais aucune idée comment faire est ce qu'il quelqu'un
qui peux me donnée une example de mon script pour déployer un printer

meric

2 réponses

Avatar
David
Bonjour Eric,

J'ai le même problème que toi, sauf que je n'ai qu'une seule imprimante.

Je te met un script qui devrait t'aider.

Chez moi, ça ne fonctionne pas, il me dit que le nom de l'imprimante est
invalide.

Pour lancer ce script (qui est en vbscript) tu créé un GPO, tu l'édites en
allant dans :

Paramètres Windows / Scripts ouverture de session / et là tu copie / colle
le script.

Pour créer le script il faut le nommer avec une extenion .vbs ! et pas bat
comme j'avais fait hier (par innatention).

Si tu trouves une autre solution, pourrais-tu me tenir au courrant car je
vais chercher toute la journée pour mettre à la disposition de mes users,
notre nouvelle imprimante.

Le problème chez moi est que les profiles que j'avais créé il y'a un an
utilise l'ancienne et non la nouvelle imprimante.

Voici le script, n'hésite pas à demander si c'est pas clair :

Le script fait en sorte de mettre à la disposition de tes user une
imprimante par rapport au nom que porte son PC, SalleInfoPC0... est le nom du
PC, tu dois le changer par rapport au nom de tes ordis.

sPrintPath = "pharmacieRICOHAfi"

Tu change aussi l'UNC

David

Option Explicit
Dim oNetwork, sPrintPath
Set oNetwork = CreateObject("WScript.Network")
Select Case oNetwork.ComputerName
Case "SalleInfoPC02"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC03"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC04"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC05"
sPrintPath = "pharmacieRICOHAfipharmacieRICOH Aficio AP410N PS"
Case "SalleInfoPC06"
sPrintPath = "pharmacieRICOHAfiRICOH Aficio AP410N PS"
Case "SalleInfoPC07"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC08"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC09"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC10"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC11"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC12"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC13"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC14"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC15"
sPrintPath = "pharmacieRICOH Aficio AP410N PS"
Case "SalleInfoPC16"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC17"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC18"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC19"
sPrintPath = "pharmacieRICOHAfi"
Case "PHARMACIE"
sPrintPath = "pharmacieRICOHAfi*.*"
End Select
oNetwork.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath

"Eric" wrote:

Salut

Windows 2003 sp1

J'aimerais installer mais imprimanter qui sont en share sur mon serveur via
un script dans le GPO. Mais aucune idée comment faire est ce qu'il quelqu'un
qui peux me donnée une example de mon script pour déployer un printer

meric


Avatar
kevin
Salut, tu peux regarder sur cet excellent site pour tout problème de
script :
http://jc.bellamy.free.fr/fr/vbsdownload.html


Bonjour Eric,

J'ai le même problème que toi, sauf que je n'ai qu'une seule impriman te.

Je te met un script qui devrait t'aider.

Chez moi, ça ne fonctionne pas, il me dit que le nom de l'imprimante est
invalide.

Pour lancer ce script (qui est en vbscript) tu créé un GPO, tu l'éd ites en
allant dans :

Paramètres Windows / Scripts ouverture de session / et là tu copie / colle
le script.

Pour créer le script il faut le nommer avec une extenion .vbs ! et pas bat
comme j'avais fait hier (par innatention).

Si tu trouves une autre solution, pourrais-tu me tenir au courrant car je
vais chercher toute la journée pour mettre à la disposition de mes us ers,
notre nouvelle imprimante.

Le problème chez moi est que les profiles que j'avais créé il y'a u n an
utilise l'ancienne et non la nouvelle imprimante.

Voici le script, n'hésite pas à demander si c'est pas clair :

Le script fait en sorte de mettre à la disposition de tes user une
imprimante par rapport au nom que porte son PC, SalleInfoPC0... est le no m du
PC, tu dois le changer par rapport au nom de tes ordis.

sPrintPath = "pharmacieRICOHAfi"

Tu change aussi l'UNC

David

Option Explicit
Dim oNetwork, sPrintPath
Set oNetwork = CreateObject("WScript.Network")
Select Case oNetwork.ComputerName
Case "SalleInfoPC02"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC03"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC04"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC05"
sPrintPath = "pharmacieRICOHAfipharmacieRICOH Aficio AP410N PS"
Case "SalleInfoPC06"
sPrintPath = "pharmacieRICOHAfiRICOH Aficio AP410N PS"
Case "SalleInfoPC07"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC08"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC09"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC10"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC11"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC12"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC13"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC14"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC15"
sPrintPath = "pharmacieRICOH Aficio AP410N PS"
Case "SalleInfoPC16"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC17"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC18"
sPrintPath = "pharmacieRICOHAfi"
Case "SalleInfoPC19"
sPrintPath = "pharmacieRICOHAfi"
Case "PHARMACIE"
sPrintPath = "pharmacieRICOHAfi*.*"
End Select
oNetwork.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath

"Eric" wrote:

Salut

Windows 2003 sp1

J'aimerais installer mais imprimanter qui sont en share sur mon serveur via
un script dans le GPO. Mais aucune idée comment faire est ce qu'il qu elqu'un
qui peux me donnée une example de mon script pour déployer un print er

meric