[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 858
  • Last Modified:

Deploying Microsoft IPP Printing

Alright experts I need some advice and possibly some scripting help.  I currently have around 200 machines using Novell NDS printing.  We are in the process of migrating to the Microsoft IPP solution but I need help with the deployment and I really don't want to do this manually.  We have a print server with Windows Server 2003 R2, and all the clients are XP.  I've read that you can deploy the printers through group policy, however the with the way the OU's are setup this is an impracticle solution.  I need to be able to deploy the printers dependant on location or a group.  So here's the question, does anybody know a way to:
First: Delete the existing NDS printers from the machine.
Second: Deploy the new Microsoft IPP printers dependant on group or location
Third: Once the printer is deployed set the default for each particular group.

I figure a script could probably do all of this, but I am very inexperienced in scripting.
Thanks,
Kris
0
kjmeldrum
Asked:
kjmeldrum
  • 3
1 Solution
 
JjcampNRCommented:
When you say group, do you mean OU in active directory, security group, or something else?  As for location, I assume you mean physical location of the PC - this isn't really useful from a scripting point of view.  I should be able to provide you with a script once you let me know what you mean by group.
0
 
kjmeldrumAuthor Commented:
Hi,
I'm refering to a security group.  Due to the OU structure we have it would be impossible to split up via OU so I'm forced to use security groups instead.
Thanks
0
 
JjcampNRCommented:
OK, I'll try and get you a sample tonight or early tomorrow - I have a script I typically use on my home machine and need to grab it for you.
0
 
JjcampNRCommented:
Give the following a shot, it may need some testing in your environment, and make sure you change group names, printer/server names, etc in the appropritate locations.  This will check the AD security group membership of a user (typically during logon) and if they're in the group listed run the commands under it (to add/delete printers).  It will also set the default printer to whichever you specify, feel free to edit as necessary.  I also gave you a section on mapping a home drive (or any other file share using group membership as well) don't know if that's helpful or not.  Let me know if you get any errors, make sure you test it before deploying.  Everything below here is part of the script, put it in a text file, edit it, then change the extension to .vbs and give it a whirl.
---------------------------------------------------------------------

Option Explicit

'************************************************************************************
' Created by: JjcampNR                                                    *
' Copyright Notice: None - enjoy freely.                                  *
' Last Modified: 10/09/2007                                              *
' Abstract: Remove old printers and add new based on AD security group memebership  *
'************************************************************************************

' Set error handling
On Error Resume Next
Error.Clear

' Declarations
Const OverwriteExisting = True
Dim objNetwork, objFSO, strGroupName, strDomain, strUser, bolIsMember
Dim objUser, objGroup, objFileOnServer, objFileOnClient

Set objNetwork = WScript.CreateObject("WScript.Network")
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set WshNetwork = WScript.CreateObject("WScript.Network")

' Find domain membership function
Function IsMemberOf(strGroupName)
  Set objNetwork = Wscript.CreateObject("WScript.Network")
  strDomain = objNetwork.UserDomain
  strUser = objNetwork.UserName
  bolIsMember = False
  Set objUser = GetObject("WinNT://" & strDomain & "/" & _
    strUser & ",user")
  For Each objGroup In objUser.Groups
    If objGroup.Name = strGroupName Then
      bolIsMember = True
      Exit For
    End If
  Next
  IsMemberOf = bolIsMember
End Function

' Network drive mappings

' Delete and map drive H:
obj.Network.RemoveNetworkDrive "H:", , True
obj.Network.MapNetworkDrive "H:", "\\Server\Homes\user", true
Err.Clear

' End of network drive mappings
' MsgBox "End of drive mappings."


If IsMemberOf("_SecurityGroup") Then

  'Remove Printers
  objNetwork.RemovePrinterConnection "\\Server\OldPrinter"

  ' Add Printers
  WshNetwork.AddWindowsPrinterConnection "\\Server\NewPrinter

  'Set Default Printer
  WshNetwork.SetDefaultPrinter "\\Server\Printer1"


End If

Err.clear

If IsMemberOf("_SecurityGroup2") Then

  'Remove Printers
  objNetwork.RemovePrinterConnection "\\Server\OldPrinter"

  ' Add Printers
  WshNetwork.AddWindowsPrinterConnection "\\Server\NewPrinter

  'Set Default Printer
  WshNetwork.SetDefaultPrinter "\\Server\Printer1"
End If

' MsgBox "End of script."
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now