G
Glenn L
I am looking to implement the following solution for my company.
When a wokstation boots or the user logs in (i haven't decided which one
makes the most sense), a vbscript launchs to automatically install all
printers with the general vicinity of the workstation.
I would like to utilize the location attribute on the workstations and
printers.
The following would be the general flow of the script.
connect to and query local WMI for the local machine name.
Use the results to do an ADSI query to AD for the location attribute string
for this workstation name.
Use this result to do another ADSI query for the collection of printers that
have this same string for their location attribute.
Loop through the list.
For each match, perform an ADSI query for the UNCNAME attribute of the
printer and use WMI to install the printer connection to the users profile.
'''alteratively if the script is a computer startup script, it could launch
the shell comand rundll32 printui.dll,printuientry to install the network
printer connections as global connections i.e. stored in HKLM'''
My challenge is I don't have the scripting skills to do this.
the local WMI query and initial ADSI query are easy enough.
It's the query to get the collection of all matching printers, and looping
through each one to create the printer connection that I don't know how to
do.
Also, I'm not sure how to deal with default printers in the script, not to
mention some needs for LPT port mappings.
Has anybody tackled anything similiar that they would be willing to share
script samples?
Any hints or article references to get me through creating the script would
be greatly appreciated.
When a wokstation boots or the user logs in (i haven't decided which one
makes the most sense), a vbscript launchs to automatically install all
printers with the general vicinity of the workstation.
I would like to utilize the location attribute on the workstations and
printers.
The following would be the general flow of the script.
connect to and query local WMI for the local machine name.
Use the results to do an ADSI query to AD for the location attribute string
for this workstation name.
Use this result to do another ADSI query for the collection of printers that
have this same string for their location attribute.
Loop through the list.
For each match, perform an ADSI query for the UNCNAME attribute of the
printer and use WMI to install the printer connection to the users profile.
'''alteratively if the script is a computer startup script, it could launch
the shell comand rundll32 printui.dll,printuientry to install the network
printer connections as global connections i.e. stored in HKLM'''
My challenge is I don't have the scripting skills to do this.
the local WMI query and initial ADSI query are easy enough.
It's the query to get the collection of all matching printers, and looping
through each one to create the printer connection that I don't know how to
do.
Also, I'm not sure how to deal with default printers in the script, not to
mention some needs for LPT port mappings.
Has anybody tackled anything similiar that they would be willing to share
script samples?
Any hints or article references to get me through creating the script would
be greatly appreciated.