PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms..win.server.scripting > VBScript created to add printers to group in AD...
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
VBScript created to add printers to group in AD...

Réponse
 
LinkBack Outils de la discussion
Vieux 28/09/2007, 13h45   #1
Syed
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut VBScript created to add printers to group in AD...

Hi,

I have added a script to add printers on the network to a particular group
in GPO and its working absolutely fine. The problem is when i login to any
server this script is run automatically and printers are added on that server
which i dont want. I was just wondering if there is any check we can add in
that script to check the server name and we can restrict that script to run
on particular machine like servers. Because i dont want printers to be added
on the servers.

Thanks.

Syed.
  Réponse avec citation
Vieux 28/09/2007, 14h58   #2
Richard Mueller [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: VBScript created to add printers to group in AD...

Syed wrote:

> I have added a script to add printers on the network to a particular group
> in GPO and its working absolutely fine. The problem is when i login to any
> server this script is run automatically and printers are added on that
> server
> which i dont want. I was just wondering if there is any check we can add
> in
> that script to check the server name and we can restrict that script to
> run
> on particular machine like servers. Because i dont want printers to be
> added
> on the servers.


Sounds like the logon script should be applied to computers rather than
users, and the servers should not be in the OU the GPO applies to. That
would be the easiest solution. Otherwise, the script can read the
operatingSystem attribute of the computer object and parse for the string
"server". In vbscript:

Set objSysInfo = CreateObject("ADSystemInfo")
strComputerDN = objSysInfo.ComputerName
Set objComputer = GetObject("LDAP://" & strComputerDN)
strOS = objComputer.operatingSystem
If (InStr(LCase(strOS), "server") > 0) Then
' Local computer has a server operating system.
End If

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h01.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07032 seconds with 10 queries