OVH Cloud OVH Cloud

Ecriture de script de démarrage et de logon

2 réponses
Avatar
l'Bru
Bonjour,

Comment écrire un script qui défini pour tous les ordinateurs d'une OU les
serveurs DNS suivants :
10.n.n.122
10.n.n.126
193.50.n.4

Et un script qui défini pour chaque utilisateur d'une OU les imprimantes
installées sur :
\\TelOuTelPC\imp1
\\TelAutrePC\imp2

Et ou les installer dans à partir de "Utilisateurs et ordinateurs Active
Directory" ?

Merci d'avance,

Bruno.

2 réponses

Avatar
Fabricem [MS]
Bonjour

Si les postes de travail sont en XP ou WIndows 2000, il est possible de
configurer dans les stratégie de groupe l'adresse des serveurs DNS et idem
pour la connexion aux imprimantes

donc créer une stratégie de groupe sur l'objet OU en question
Modifier les paramètres
Ordinateurs modèles d'administrationréseauClient DNS serveur DNS


Pour les utilisateurs de l'ou, paramètres utilisateur ajouter un script de
démarrage logon.vbs en utilisant wsh et addwindowsprinterconnection

exemple

AddWindowsPrinterConnection Method WSH Reference
Version 2

Applies To


--------------------------------------------------------------------------------

Description
Adds a printer connection to Windows.
Syntax
Windows NT/Windows 2000:
object.AddWindowsPrinterConnection(strPrinterPath)

Windows 95/98:
object.AddWindowsPrinterConnection(strPrinterPath,
strDriverName[,strPort])
Parameters
Part Description
object WshNetwork object.
strPrinterPath Path to the printer.
strDriverName Name of the driver to use. Required on Windows 95/98;
ignored if used on Windows NT/Windows 2000.
strPort Optional. Specifies the port to which to attach the printer
on Windows 95/98. Default is LPT1. Ignored if used on Windows NT/Windows
2000.

Remarks
Using this method is the same as using the Control Panel/Printers to add a
printer connection. Unlike the AddPrinterConnection method, this method
allows you to create a printer connection without directing it to a specific
port such as LPT1. If the connection fails, an error occurs.
In Windows 95/98 the printer driver must already be installed on the
machine in order for the AddWindowsPrinterConnection method to work. If the
driver is not installed Windows will return the error message "Unknown
printer driver".

Example
The following example uses the AddWindowsPrinterConnection method to
connect a network printer to LPT1.
Set WshNetwork = CreateObject("WScript.Network")
Set PrinterPath = "printservDefaultPrinter"
Set PrinterDriver = "Lexmark Optra S 1650"
Set rc = WshNetwork.AddWindowsPrinterConnection(PrinterPath, PrinterDriver)
If Not rc then
WScript.Echo("Printer Connection Failed!")
End If
Cdlt
--
Fabrice Meillon
Architecte Infrastructure
Division Développeurs et Plate-Forme d'Entreprise
Microsoft France


"l'Bru" wrote in message
news:
Bonjour,

Comment écrire un script qui défini pour tous les ordinateurs d'une OU les
serveurs DNS suivants :
10.n.n.122
10.n.n.126
193.50.n.4

Et un script qui défini pour chaque utilisateur d'une OU les imprimantes
installées sur :
TelOuTelPCimp1
TelAutrePCimp2

Et ou les installer dans à partir de "Utilisateurs et ordinateurs Active
Directory" ?

Merci d'avance,

Bruno.



Avatar
l'Bru
Bonjour,

Merci à Fabrice mais je n'ais pas les items Client DNS et serveur DNS dans
"Configuration Ordinateur modèles d'administrationréseau" dans la fenêtre
"Stratégie de groupe" , je n'ais que "Fichiers hors connexion" et
"Connexions réseau et accès à distance". Je suis au bon endroit ou bien je
me plante complètement ?

Bruno.

"Fabricem [MS]" a écrit dans le message de
news: e$
Bonjour

Si les postes de travail sont en XP ou WIndows 2000, il est possible de
configurer dans les stratégie de groupe l'adresse des serveurs DNS et idem
pour la connexion aux imprimantes

donc créer une stratégie de groupe sur l'objet OU en question
Modifier les paramètres
Ordinateurs modèles d'administrationréseauClient DNS serveur DNS


Pour les utilisateurs de l'ou, paramètres utilisateur ajouter un script de
démarrage logon.vbs en utilisant wsh et addwindowsprinterconnection

exemple

AddWindowsPrinterConnection Method WSH Reference
Version 2

Applies To


--------------------------------------------------------------------------------

Description
Adds a printer connection to Windows.
Syntax
Windows NT/Windows 2000:
object.AddWindowsPrinterConnection(strPrinterPath)

Windows 95/98:
object.AddWindowsPrinterConnection(strPrinterPath,
strDriverName[,strPort])
Parameters
Part Description
object WshNetwork object.
strPrinterPath Path to the printer.
strDriverName Name of the driver to use. Required on Windows 95/98;
ignored if used on Windows NT/Windows 2000.
strPort Optional. Specifies the port to which to attach the printer
on Windows 95/98. Default is LPT1. Ignored if used on Windows NT/Windows
2000.

Remarks
Using this method is the same as using the Control Panel/Printers to add
a printer connection. Unlike the AddPrinterConnection method, this method
allows you to create a printer connection without directing it to a
specific port such as LPT1. If the connection fails, an error occurs.
In Windows 95/98 the printer driver must already be installed on the
machine in order for the AddWindowsPrinterConnection method to work. If
the driver is not installed Windows will return the error message "Unknown
printer driver".

Example
The following example uses the AddWindowsPrinterConnection method to
connect a network printer to LPT1.
Set WshNetwork = CreateObject("WScript.Network")
Set PrinterPath = "printservDefaultPrinter"
Set PrinterDriver = "Lexmark Optra S 1650"
Set rc = WshNetwork.AddWindowsPrinterConnection(PrinterPath,
PrinterDriver)
If Not rc then
WScript.Echo("Printer Connection Failed!")
End If
Cdlt
--
Fabrice Meillon
Architecte Infrastructure
Division Développeurs et Plate-Forme d'Entreprise
Microsoft France


"l'Bru" wrote in message
news:
Bonjour,

Comment écrire un script qui défini pour tous les ordinateurs d'une OU
les serveurs DNS suivants :
10.n.n.122
10.n.n.126
193.50.n.4

Et un script qui défini pour chaque utilisateur d'une OU les imprimantes
installées sur :
TelOuTelPCimp1
TelAutrePCimp2

Et ou les installer dans à partir de "Utilisateurs et ordinateurs Active
Directory" ?

Merci d'avance,

Bruno.