|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 -- |
|
![]() |
| Outils de la discussion | |
|
|