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

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

Sharing printer on Domain

I have creted a domain in my network and restricted users with GPO's to acess desktop, start menu and many commands i wanted to share the Network printer on printing server by default is there any option ..that the printer is isntalled automatically as user login through login script or throgh any policy kindly tell off.
waiting for reply
0
pawankk
Asked:
pawankk
  • 8
  • 6
  • 4
  • +1
1 Solution
 
drawlinCommented:
If I understand you correctly, you wish to use a logon script to attach a network printer and set a defaut printer.  That is easily done by creating a group policy and using a vbscript.

Microsoft has alot of sample scripts for printers here: http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true
0
 
pawankkAuthor Commented:
is there any other way to install and make the printer default except group policy
0
 
PhilstarfishCommented:
yip, image all your installation.... :-0   ??
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
pawankkAuthor Commented:
image installation how to image printer installed but how ??
0
 
PhilstarfishCommented:
install one machine and then image cast onto the next machine from the network. using a stiffy drive or flash as boot up over the LAN.
0
 
drawlinCommented:
There are lots of ways to attach to network printers, but the easiest way for the administrator to force it is to use Group Policy and a script.  You could create a shortcut on your desktop with the path: \\servername\printername and copy that onto other desktops and instruct users to double-click.  That will connect but not make it the default printer.

I would still go with a logon script in Group Policy.
0
 
aplonaCommented:
I would use a vbs script like this:

set WshNetwork=CreateObject ("Wscript.Network")
WshNetwork.AddWindowsPrinterConnection "\\servername\sharename"
WshNetwork.SetDefaultPrinter "\\servername\sharename"

0
 
PhilstarfishCommented:
this could be costly and needs to install a fixed print server - and this stops other network printer installations.... but if this is you intention then this is the way to go as from drawlin. its the best way.
I hav a network print server thats linked from a GPO to all machines on the domain..
0
 
pawankkAuthor Commented:
aplona   & drawlin

I have tried these VBscripts for instaling printer  through a batch file as longon script. But all there is no result kindly tell me how to write these scirpts.
0
 
drawlinCommented:
Use the text in the examples and save them as a .vbs file.  When you assign the logon script, browse and take note of the folder that the "browse" starts in (E198FA.........)  It will be the SID for the OU that you are assigning the script to.

Let me back up.  You need to assign the script via group policy for an OU rather than in the user properties for the user.

Once you have identified the folder that you browsed for (\\DCserver\sysvol\E198FA....\users\scripts\logon )  Put the .vbs file in that directory, then while you are assigning a logon script for the Group policy for the OU point it to the .vbs file.  

I'm sorry, I don't have a AD server in front of me and I can't remember the path exactally, so you may have to drill down a bit deeper than \\DCserver\sysvol to find the folder with named for the SID of the OU that you are applying the script to.
0
 
PhilstarfishCommented:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_

objPrinter.DriverName = "HP LaserJet 4000 Series PS"
objPrinter.PortName   = "IP_169.254.110.160"
objPrinter.DeviceID   = "ScriptedPrinter"
objPrinter.Location = "USA/Redmond/Building 37/Room 114"
objPrinter.Network = True
objPrinter.Shared = True
objPrinter.ShareName = "ScriptedPrinter"
objPrinter.Put_

0
 
pawankkAuthor Commented:
aplona  & Philstarfish

set WshNetwork=CreateObject ("Wscript.Network")
WshNetwork.AddWindowsPrinterConnection "\\192.168.0.100\HPBusine"
WshNetwork.AddWindowsPrinterConnection "\\192.168.0.100\SamsungM"
WshNetwork.SetDefaultPrinter "\\192.168.0.100\HPBusine"

the following error is occuring

line:4
char :1
error : The system cannot find the file specified
code: 8007000
source (null)
0
 
aplonaCommented:
try it without line 4,(remove the line with the set default printer) and see if it maps the printers.  This will give us a starting point.
0
 
pawankkAuthor Commented:
printers are installed but no default printer is selected in the list but some time it give these error

line: 2
char: 1
error : overlapped I/O operation is in progress
code: 800703E5
source:null

aplona another question  want to map netwrok drive through scripting can it be possible i have used the following line will it work

WshNetwork.MapNetworkDrive "Z:", "\\192.168.0.100\transfer"
0
 
aplonaCommented:
yes that will work.  Thats the same liine I have always used.
0
 
aplonaCommented:
I don't know about that error though.  I have been using this script for years and never had problems.
0
 
pawankkAuthor Commented:
aplona any solution ofr this error
0
 
aplonaCommented:
Does this happen on every computer?  If it does then try to recreate the printer
0
 
pawankkAuthor Commented:
Aplona i have tried this batch file on other computer which ar not on domain only in workgroup

there is no error as such in those independent pc

and the pc on domain is giving error.

overlapped I/O operation is in progress

I think  some operation is processing while login script is processed can we pause  login script for ffew seconds or minutes and then execute it after few minutes ..wait or pause  any such command.
0
 
aplonaCommented:
Remove the script from the gpo and run the file after the person has already logged in and see if you still get the error.
0
 
pawankkAuthor Commented:
Yah its not working i have tried it in without applying in GPO. But yet another intresting thing i saw it installs the printer but it does not make it default. i gave to discccontct the printer in log off script to ..but didnt succeded
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 8
  • 6
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now