Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Windows Server 2003 / Scripting / September 2007

Tip: Looking for answers? Try searching our database.

VBScript created to add printers to group in AD...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Syed - 28 Sep 2007 13:45 GMT
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.
Richard Mueller [MVP] - 28 Sep 2007 14:58 GMT
> 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
[quoted text clipped - 7 lines]
> 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

Signature

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.