none
script to add new network printers

    Question

  • hello we have one server that has all printer queues installed.

    we would like to automatically install these printers on all client machines...without any user inetraction.

    can you provide a sample script to be used? and what would be the best location to use this? GPO ? Login script? etc.

    Saturday, December 04, 2010 7:36 PM

Answers

  • There are several methods and since you're asking in the scripting guys forum, you must be wondering about automation using scripting.  Oliver has covered deployment with Powershell.  If you already have vbscript login scripts then you could use objNetwork.AddWindowsPrinterConnection in your script.  Way back in the day I used vbscripts to query LDAP:// for group membership, and then deploy printers in script based on that group membership.  Here is a quickly sanitized version of my old login script that maps drives and printers.  

    NOTE:  Some of this stuff was copy/pasted directly from the interwebz and the huge credits at the tops of the scripts were removed in order to aid our ease of use.  So if anyone sees their code in here without attribution to them, please understand that this was an internal-only login script that was never written for the purpose of being republished.  I make no claim to your code and give you full credit. We simply pieced stuff together until it worked:

    Option Explicit 'only resume next within functions
    
    Dim objNetwork, objSysInfo, strUserDN, objShell, objLogFile, objDebug, objGroupList, objUser, objFSO, strComputerDN, objComputer
    Dim objADUser, strGroup, adoCommand, adoConnection, strBase, strAttributes, objUserName
    
    Set objNetwork = CreateObject("Wscript.Network")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objSysInfo = CreateObject("ADSystemInfo")
    Set objShell = CreateObject("WScript.Shell")
    Set objLogfile = objFSO.CreateTextFile(objShell.ExpandEnvironmentStrings("%temp%") & "\loginscript.txt", True) 'overwrites each use
    strUserDN = objSysInfo.userName
    strComputerDN = objSysInfo.computerName
    strUserDN = Replace(strUserDN, "/", "\/") 'flip the slashes
    strComputerDN = Replace(strComputerDN, "/", "\/") 'flip the slashes
    Set objUser = GetObject("LDAP://" & strUserDN)
    Set objComputer = GetObject("LDAP://" & strComputerDN)
    
    CheckForDebug
    isMember objUser, "This is to prepopulate the objGroupList"
    SortDictionary objGroupList,1 'sort the objGroup list
    OutputGroups objGroupList' print the objGroup list
    DeleteNormaldotDot 'kill that troublesome file
    
    
    output "################################"
    output "### Map Drives"
    output "################################"
    MapDrive "domain users","h:","\\fileserver\users\" & objUserName,"Home"
    MapDrive "domain users","s:","\\fileserver\Common","Common Drive"
    
    output "################################"
    output "### Map Printers"
    output "################################"
    MapPrinter "Testgroup","\\printserver\PrinterShareName""
    <strong>MapPrinter "Domain Users","\\printserver\PrinterShareName"</strong>
    
    
    ' Clean up.
    Set objNetwork = Nothing
    Set objFSO = Nothing
    Set objSysInfo = Nothing
    Set objShell = Nothing
    Set objLogfile = Nothing
    Set objUser = Nothing
    Set objComputer = Nothing
    
    Function output(Text)
    	if objDebug = true then
    		wscript.echo Text
    	end if
    objLogfile.writeline Text
    end function
    
     Function SortDictionary(objDict, intSort)
     ' generic function for sorting any dictionary object. intSort = 1(dictKey) or 2(dictItem)
    
      ' declare constants
      Const dictKey = 1
      Const dictItem = 2
    
      ' declare our variables
      Dim strDict()
      Dim objKey
      Dim strKey,strItem
      Dim X,Y,Z
    
      ' get the dictionary count
      Z = objDict.Count
    
      ' we need more than one item to warrant sorting
      If Z > 1 Then
       ' create an array to store dictionary information
       ReDim strDict(Z,2)
       X = 0
       ' populate the string array
       For Each objKey In objDict
         strDict(X,dictKey) = CStr(objKey)
         strDict(X,dictItem) = CStr(objDict(objKey))
         X = X + 1
       Next
    
       ' perform a a shell sort of the string array
       For X = 0 To (Z - 2)
        For Y = X To (Z - 1)
         If StrComp(strDict(X,intSort),strDict(Y,intSort),vbTextCompare) > 0 Then
           strKey = strDict(X,dictKey)
           strItem = strDict(X,dictItem)
           strDict(X,dictKey) = strDict(Y,dictKey)
           strDict(X,dictItem) = strDict(Y,dictItem)
           strDict(Y,dictKey) = strKey
           strDict(Y,dictItem) = strItem
         End If
        Next
       Next
    
       ' empty the dictionary object
       objDict.RemoveAll
    
       ' repopulate the dictionary with the sorted information
       For X = 0 To (Z - 1)
        objDict.Add strDict(X,dictKey), strDict(X,dictItem)
       Next
    
      End If
     End Function
     
    Function OutputGroups(GroupList)
    
    	output "################################"
    	output "### Group Membership"
    	output "################################"
    	Dim item
    	for each item in GroupList
    		output item
    	next
    	output "################################"
    End Function
    
    
    Function MapDrive(ByVal strGroup,ByVal strDriveLetter,ByVal strPath,ByVal strDescription)
    	If (IsMember(objUser, strGroup) = True) Then
    		output " "
    		output " " & strDriveLetter & " " & strPath
    		If (MapDrives(strDriveLetter, strPath) = False) Then
    			output "  Failed"
    		End If
    	End If
    End function
    
    Function MapPrinter(strGroup, strConnection)
    on error resume next
    	If (IsMember(objComputer, strGroup) = True) Then
    	output "  " & strConnection
    		objNetwork.AddWindowsPrinterConnection strConnection
    	End If
    End Function
    
    Function IsMember(ByVal objADObject, ByVal strGroupNTName)
      ' Function to test for group membership.
      ' objADObject is a user or computer object.
      ' strGroupNTName is the NT name (sAMAccountName) of the group to test.
      ' objGroupList is a dictionary object, with global scope.
      ' Returns True if the user or computer is a member of the group.
      ' Subroutine LoadGroups is called once for each different objADObject.
    
      Dim objRootDSE, strDNSDomain
    
      ' The first time IsMember is called, setup the dictionary object
      ' and objects required for ADO.
      If (IsEmpty(objGroupList) = True) Then
        Set objGroupList = CreateObject("Scripting.Dictionary")
        objGroupList.CompareMode = vbTextCompare
    
        Set adoCommand = CreateObject("ADODB.Command")
        Set adoConnection = CreateObject("ADODB.Connection")
        adoConnection.Provider = "ADsDSOObject"
        adoConnection.Open "Active Directory Provider"
        adoCommand.ActiveConnection = adoConnection
    
        Set objRootDSE = GetObject("LDAP://RootDSE")
        strDNSDomain = objRootDSE.Get("defaultNamingContext")
    
        adoCommand.Properties("Page Size") = 100
        adoCommand.Properties("Timeout") = 30
        adoCommand.Properties("Cache Results") = False
    
        ' Search entire domain.
        strBase = "<LDAP://" & strDNSDomain & ">"
        ' Retrieve NT name of each group.
        strAttributes = "sAMAccountName"
    
        ' Load group memberships for this user or computer into dictionary
        ' object.
        Call LoadGroups(objADObject)
        Set objRootDSE = Nothing
      End If
      If (objGroupList.Exists(objADObject.sAMAccountName & "\") = False) Then
        ' Dictionary object established, but group memberships for this
        ' user or computer must be added.
        Call LoadGroups(objADObject)
      End If
      ' Return True if this user or computer is a member of the group.
      IsMember = objGroupList.Exists(strGroupNTName)
    End Function
    
    Sub LoadGroups(ByVal objADObject)
      ' Subroutine to populate dictionary object with group memberships.
      ' objGroupList is a dictionary object, with global scope. It keeps track
      ' of group memberships for each user or computer separately. ADO is used
      ' to retrieve the name of the group corresponding to each objectSid in
      ' the tokenGroup array. Based on an idea by Joe Kaplan.
    
      Dim arrbytGroups, k, strFilter, adoRecordset, strGroupName, strQuery
    
      ' Add user name to dictionary object, so LoadGroups need only be
      ' called once for each user or computer.
      objGroupList.Add objADObject.sAMAccountName & "\", True
    	objUserName = objADObject.sAMAccountName
    
      ' Retrieve tokenGroups array, a calculated attribute.
      objADObject.GetInfoEx Array("tokenGroups"), 0
      arrbytGroups = objADObject.Get("tokenGroups")
    
      ' Create a filter to search for groups with objectSid equal to each
      ' value in tokenGroups array.
      strFilter = "(|"
      If (TypeName(arrbytGroups) = "Byte()") Then
        ' tokenGroups has one entry.
        strFilter = strFilter & "(objectSid=" & OctetToHexStr(arrbytGroups) & ")"
      ElseIf (UBound(arrbytGroups) > -1) Then
        ' TokenGroups is an array of two or more objectSid's.
        For k = 0 To UBound(arrbytGroups)
          strFilter = strFilter & "(objectSid=" & OctetToHexStr(arrbytGroups(k)) & ")"
        Next
      Else
        ' tokenGroups has no objectSid's.
        Exit Sub
      End If
      strFilter = strFilter & ")"
    
      ' Use ADO to search for groups whose objectSid matches any of the
      ' tokenGroups values for this user or computer.
      strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
      adoCommand.CommandText = strQuery
      Set adoRecordset = adoCommand.Execute
    
      ' Enumerate groups and add NT name to dictionary object.
      Do Until adoRecordset.EOF
        strGroupName = adoRecordset.Fields("sAMAccountName").Value
        objGroupList.Add strGroupName, True
        adoRecordset.MoveNext
      Loop
      adoRecordset.Close
    
      Set adoRecordset = Nothing
    End Sub
    
    Function OctetToHexStr(ByVal arrbytOctet)
      ' Function to convert OctetString (byte array) to Hex string,
      ' with bytes delimited by \ for an ADO filter.
    
      Dim k
      OctetToHexStr = ""
      For k = 1 To Lenb(arrbytOctet)
        OctetToHexStr = OctetToHexStr & "\" & Right("0" & Hex(Ascb(Midb(arrbytOctet, k, 1))), 2)
      Next
    End Function
    
    
    Function MapDrives(ByVal strDrive, ByVal strShare)
    
      Dim objDrive
    
      On Error Resume Next
      If (objFSO.DriveExists(strDrive) = True) Then
        Set objDrive = objFSO.GetDrive(strDrive)
        If (Err.Number <> 0) Then
          On Error GoTo 0
          MapDrives = False
          Exit Function
        End If
        If (objDrive.DriveType = 3) Then
          objNetwork.RemoveNetworkDrive strDrive, True, True
        Else
          MapDrives = False
          Exit Function
        End If
        Set objDrive = Nothing
      End If
      objNetwork.MapNetworkDrive strDrive, strShare
      If (Err.Number = 0) Then
        MapDrives = True
      Else
        Err.Clear
        MapDrives = False
      End If
      On Error GoTo 0
    End Function
    
    Function DeleteNormaldotDot ()
    on error resume next
    output " "
    output "### Checking for normal.dot"
    	dim objNormaldotDot, objNormaldotDotm
    	objNormaldotDot = objShell.ExpandEnvironmentStrings("%appdata%") & "\Microsoft\Templates\Normal.dot"
    	objNormaldotDotm = objShell.ExpandEnvironmentStrings("%appdata%") & "\Microsoft\Templates\Normal.dotm"	
    	If objFSO.FileExists(objNormaldotDot) Then
    		objFSO.DeleteFile objNormaldotDot
    		output "Deleted:  " & objNormaldotDot
    	End If 
    	If objFSO.FileExists(objNormaldotDotm) Then
    		objFSO.DeleteFile objNormaldotDotm
    		output "Deleted:  " & objNormaldotDotm
    	End If 	
    output " "	
    End Function
    
    'Look for debug command line switch.
    Function CheckForDebug
    if WScript.Arguments.Count <> 0 Then
    	If WScript.Arguments(0) = "debug" OR WScript.Arguments(0) = "Debug" OR WScript.Arguments(0) = "DEBUG" Then
    		objDebug = true
    		On Error Goto 0	'clear on error resume next	
    	end if
    end if
    end Function
    

     

    My preference now, however, is to use native GPO's for as much as possible for the purpose of having a single tool for managing the clients.  In my current environment with 2008 R2 role masters and Windows 7 clients, I now deploy printers using the new group policy objects.  See http://technet.microsoft.com/en-us/library/cc731292.aspx .

    Monday, December 06, 2010 5:42 PM

All replies

  • I would do it in a login script with something like this:

    # PowerShell for Mapping a Printer
    # Author: Guy Thomas
    # Version 1.3 July 2008 tested on PowerShell v 1.0
    
    $PrinterPath = "\\Server\PrintShare"
    $net = new-Object -com WScript.Network
    $net.AddWindowsPrinterConnection($PrinterPath)
    
    

    you can write the printer name or paths to a txt file and read it into the script for easy maintenance.

     

    Monday, December 06, 2010 3:46 AM
    Moderator
  • There are several methods and since you're asking in the scripting guys forum, you must be wondering about automation using scripting.  Oliver has covered deployment with Powershell.  If you already have vbscript login scripts then you could use objNetwork.AddWindowsPrinterConnection in your script.  Way back in the day I used vbscripts to query LDAP:// for group membership, and then deploy printers in script based on that group membership.  Here is a quickly sanitized version of my old login script that maps drives and printers.  

    NOTE:  Some of this stuff was copy/pasted directly from the interwebz and the huge credits at the tops of the scripts were removed in order to aid our ease of use.  So if anyone sees their code in here without attribution to them, please understand that this was an internal-only login script that was never written for the purpose of being republished.  I make no claim to your code and give you full credit. We simply pieced stuff together until it worked:

    Option Explicit 'only resume next within functions
    
    Dim objNetwork, objSysInfo, strUserDN, objShell, objLogFile, objDebug, objGroupList, objUser, objFSO, strComputerDN, objComputer
    Dim objADUser, strGroup, adoCommand, adoConnection, strBase, strAttributes, objUserName
    
    Set objNetwork = CreateObject("Wscript.Network")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objSysInfo = CreateObject("ADSystemInfo")
    Set objShell = CreateObject("WScript.Shell")
    Set objLogfile = objFSO.CreateTextFile(objShell.ExpandEnvironmentStrings("%temp%") & "\loginscript.txt", True) 'overwrites each use
    strUserDN = objSysInfo.userName
    strComputerDN = objSysInfo.computerName
    strUserDN = Replace(strUserDN, "/", "\/") 'flip the slashes
    strComputerDN = Replace(strComputerDN, "/", "\/") 'flip the slashes
    Set objUser = GetObject("LDAP://" & strUserDN)
    Set objComputer = GetObject("LDAP://" & strComputerDN)
    
    CheckForDebug
    isMember objUser, "This is to prepopulate the objGroupList"
    SortDictionary objGroupList,1 'sort the objGroup list
    OutputGroups objGroupList' print the objGroup list
    DeleteNormaldotDot 'kill that troublesome file
    
    
    output "################################"
    output "### Map Drives"
    output "################################"
    MapDrive "domain users","h:","\\fileserver\users\" & objUserName,"Home"
    MapDrive "domain users","s:","\\fileserver\Common","Common Drive"
    
    output "################################"
    output "### Map Printers"
    output "################################"
    MapPrinter "Testgroup","\\printserver\PrinterShareName""
    <strong>MapPrinter "Domain Users","\\printserver\PrinterShareName"</strong>
    
    
    ' Clean up.
    Set objNetwork = Nothing
    Set objFSO = Nothing
    Set objSysInfo = Nothing
    Set objShell = Nothing
    Set objLogfile = Nothing
    Set objUser = Nothing
    Set objComputer = Nothing
    
    Function output(Text)
    	if objDebug = true then
    		wscript.echo Text
    	end if
    objLogfile.writeline Text
    end function
    
     Function SortDictionary(objDict, intSort)
     ' generic function for sorting any dictionary object. intSort = 1(dictKey) or 2(dictItem)
    
      ' declare constants
      Const dictKey = 1
      Const dictItem = 2
    
      ' declare our variables
      Dim strDict()
      Dim objKey
      Dim strKey,strItem
      Dim X,Y,Z
    
      ' get the dictionary count
      Z = objDict.Count
    
      ' we need more than one item to warrant sorting
      If Z > 1 Then
       ' create an array to store dictionary information
       ReDim strDict(Z,2)
       X = 0
       ' populate the string array
       For Each objKey In objDict
         strDict(X,dictKey) = CStr(objKey)
         strDict(X,dictItem) = CStr(objDict(objKey))
         X = X + 1
       Next
    
       ' perform a a shell sort of the string array
       For X = 0 To (Z - 2)
        For Y = X To (Z - 1)
         If StrComp(strDict(X,intSort),strDict(Y,intSort),vbTextCompare) > 0 Then
           strKey = strDict(X,dictKey)
           strItem = strDict(X,dictItem)
           strDict(X,dictKey) = strDict(Y,dictKey)
           strDict(X,dictItem) = strDict(Y,dictItem)
           strDict(Y,dictKey) = strKey
           strDict(Y,dictItem) = strItem
         End If
        Next
       Next
    
       ' empty the dictionary object
       objDict.RemoveAll
    
       ' repopulate the dictionary with the sorted information
       For X = 0 To (Z - 1)
        objDict.Add strDict(X,dictKey), strDict(X,dictItem)
       Next
    
      End If
     End Function
     
    Function OutputGroups(GroupList)
    
    	output "################################"
    	output "### Group Membership"
    	output "################################"
    	Dim item
    	for each item in GroupList
    		output item
    	next
    	output "################################"
    End Function
    
    
    Function MapDrive(ByVal strGroup,ByVal strDriveLetter,ByVal strPath,ByVal strDescription)
    	If (IsMember(objUser, strGroup) = True) Then
    		output " "
    		output " " & strDriveLetter & " " & strPath
    		If (MapDrives(strDriveLetter, strPath) = False) Then
    			output "  Failed"
    		End If
    	End If
    End function
    
    Function MapPrinter(strGroup, strConnection)
    on error resume next
    	If (IsMember(objComputer, strGroup) = True) Then
    	output "  " & strConnection
    		objNetwork.AddWindowsPrinterConnection strConnection
    	End If
    End Function
    
    Function IsMember(ByVal objADObject, ByVal strGroupNTName)
      ' Function to test for group membership.
      ' objADObject is a user or computer object.
      ' strGroupNTName is the NT name (sAMAccountName) of the group to test.
      ' objGroupList is a dictionary object, with global scope.
      ' Returns True if the user or computer is a member of the group.
      ' Subroutine LoadGroups is called once for each different objADObject.
    
      Dim objRootDSE, strDNSDomain
    
      ' The first time IsMember is called, setup the dictionary object
      ' and objects required for ADO.
      If (IsEmpty(objGroupList) = True) Then
        Set objGroupList = CreateObject("Scripting.Dictionary")
        objGroupList.CompareMode = vbTextCompare
    
        Set adoCommand = CreateObject("ADODB.Command")
        Set adoConnection = CreateObject("ADODB.Connection")
        adoConnection.Provider = "ADsDSOObject"
        adoConnection.Open "Active Directory Provider"
        adoCommand.ActiveConnection = adoConnection
    
        Set objRootDSE = GetObject("LDAP://RootDSE")
        strDNSDomain = objRootDSE.Get("defaultNamingContext")
    
        adoCommand.Properties("Page Size") = 100
        adoCommand.Properties("Timeout") = 30
        adoCommand.Properties("Cache Results") = False
    
        ' Search entire domain.
        strBase = "<LDAP://" & strDNSDomain & ">"
        ' Retrieve NT name of each group.
        strAttributes = "sAMAccountName"
    
        ' Load group memberships for this user or computer into dictionary
        ' object.
        Call LoadGroups(objADObject)
        Set objRootDSE = Nothing
      End If
      If (objGroupList.Exists(objADObject.sAMAccountName & "\") = False) Then
        ' Dictionary object established, but group memberships for this
        ' user or computer must be added.
        Call LoadGroups(objADObject)
      End If
      ' Return True if this user or computer is a member of the group.
      IsMember = objGroupList.Exists(strGroupNTName)
    End Function
    
    Sub LoadGroups(ByVal objADObject)
      ' Subroutine to populate dictionary object with group memberships.
      ' objGroupList is a dictionary object, with global scope. It keeps track
      ' of group memberships for each user or computer separately. ADO is used
      ' to retrieve the name of the group corresponding to each objectSid in
      ' the tokenGroup array. Based on an idea by Joe Kaplan.
    
      Dim arrbytGroups, k, strFilter, adoRecordset, strGroupName, strQuery
    
      ' Add user name to dictionary object, so LoadGroups need only be
      ' called once for each user or computer.
      objGroupList.Add objADObject.sAMAccountName & "\", True
    	objUserName = objADObject.sAMAccountName
    
      ' Retrieve tokenGroups array, a calculated attribute.
      objADObject.GetInfoEx Array("tokenGroups"), 0
      arrbytGroups = objADObject.Get("tokenGroups")
    
      ' Create a filter to search for groups with objectSid equal to each
      ' value in tokenGroups array.
      strFilter = "(|"
      If (TypeName(arrbytGroups) = "Byte()") Then
        ' tokenGroups has one entry.
        strFilter = strFilter & "(objectSid=" & OctetToHexStr(arrbytGroups) & ")"
      ElseIf (UBound(arrbytGroups) > -1) Then
        ' TokenGroups is an array of two or more objectSid's.
        For k = 0 To UBound(arrbytGroups)
          strFilter = strFilter & "(objectSid=" & OctetToHexStr(arrbytGroups(k)) & ")"
        Next
      Else
        ' tokenGroups has no objectSid's.
        Exit Sub
      End If
      strFilter = strFilter & ")"
    
      ' Use ADO to search for groups whose objectSid matches any of the
      ' tokenGroups values for this user or computer.
      strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
      adoCommand.CommandText = strQuery
      Set adoRecordset = adoCommand.Execute
    
      ' Enumerate groups and add NT name to dictionary object.
      Do Until adoRecordset.EOF
        strGroupName = adoRecordset.Fields("sAMAccountName").Value
        objGroupList.Add strGroupName, True
        adoRecordset.MoveNext
      Loop
      adoRecordset.Close
    
      Set adoRecordset = Nothing
    End Sub
    
    Function OctetToHexStr(ByVal arrbytOctet)
      ' Function to convert OctetString (byte array) to Hex string,
      ' with bytes delimited by \ for an ADO filter.
    
      Dim k
      OctetToHexStr = ""
      For k = 1 To Lenb(arrbytOctet)
        OctetToHexStr = OctetToHexStr & "\" & Right("0" & Hex(Ascb(Midb(arrbytOctet, k, 1))), 2)
      Next
    End Function
    
    
    Function MapDrives(ByVal strDrive, ByVal strShare)
    
      Dim objDrive
    
      On Error Resume Next
      If (objFSO.DriveExists(strDrive) = True) Then
        Set objDrive = objFSO.GetDrive(strDrive)
        If (Err.Number <> 0) Then
          On Error GoTo 0
          MapDrives = False
          Exit Function
        End If
        If (objDrive.DriveType = 3) Then
          objNetwork.RemoveNetworkDrive strDrive, True, True
        Else
          MapDrives = False
          Exit Function
        End If
        Set objDrive = Nothing
      End If
      objNetwork.MapNetworkDrive strDrive, strShare
      If (Err.Number = 0) Then
        MapDrives = True
      Else
        Err.Clear
        MapDrives = False
      End If
      On Error GoTo 0
    End Function
    
    Function DeleteNormaldotDot ()
    on error resume next
    output " "
    output "### Checking for normal.dot"
    	dim objNormaldotDot, objNormaldotDotm
    	objNormaldotDot = objShell.ExpandEnvironmentStrings("%appdata%") & "\Microsoft\Templates\Normal.dot"
    	objNormaldotDotm = objShell.ExpandEnvironmentStrings("%appdata%") & "\Microsoft\Templates\Normal.dotm"	
    	If objFSO.FileExists(objNormaldotDot) Then
    		objFSO.DeleteFile objNormaldotDot
    		output "Deleted:  " & objNormaldotDot
    	End If 
    	If objFSO.FileExists(objNormaldotDotm) Then
    		objFSO.DeleteFile objNormaldotDotm
    		output "Deleted:  " & objNormaldotDotm
    	End If 	
    output " "	
    End Function
    
    'Look for debug command line switch.
    Function CheckForDebug
    if WScript.Arguments.Count <> 0 Then
    	If WScript.Arguments(0) = "debug" OR WScript.Arguments(0) = "Debug" OR WScript.Arguments(0) = "DEBUG" Then
    		objDebug = true
    		On Error Goto 0	'clear on error resume next	
    	end if
    end if
    end Function
    

     

    My preference now, however, is to use native GPO's for as much as possible for the purpose of having a single tool for managing the clients.  In my current environment with 2008 R2 role masters and Windows 7 clients, I now deploy printers using the new group policy objects.  See http://technet.microsoft.com/en-us/library/cc731292.aspx .

    Monday, December 06, 2010 5:42 PM
  • Yes, this is easily possible. You can use VBS or Powershell or you can use Kixtart scripting to accomplish this.

    More details about the Powershell login script here: Powershell login script to map network drives, printers and applicaton settings

    and the Kixtart login script here: KIX login script to map network drives, printers and applicaton settings for Remote Desktop Services (Terminal) Server – Revised

    Hope that helps.

    • Proposed as answer by superfishnz Sunday, May 29, 2011 9:51 PM
    Sunday, May 29, 2011 9:51 PM