Solved

Sharing printer on Domain

Posted on 2006-11-05
21
1,108 Views
Last Modified: 2008-03-03
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
Comment
Question by:pawankk
  • 8
  • 6
  • 4
  • +1
21 Comments
 
LVL 5

Expert Comment

by:drawlin
ID: 17879132
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
 

Author Comment

by:pawankk
ID: 17879308
is there any other way to install and make the printer default except group policy
0
 

Expert Comment

by:Philstarfish
ID: 17879517
yip, image all your installation.... :-0   ??
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:pawankk
ID: 17879631
image installation how to image printer installed but how ??
0
 

Expert Comment

by:Philstarfish
ID: 17880025
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
 
LVL 5

Expert Comment

by:drawlin
ID: 17882904
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
 
LVL 3

Accepted Solution

by:
aplona earned 50 total points
ID: 17882986
I would use a vbs script like this:

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

0
 

Expert Comment

by:Philstarfish
ID: 17882998
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
 

Author Comment

by:pawankk
ID: 18005825
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
 
LVL 5

Expert Comment

by:drawlin
ID: 18006503
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
 

Expert Comment

by:Philstarfish
ID: 18006595
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
 

Author Comment

by:pawankk
ID: 18036066
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
 
LVL 3

Expert Comment

by:aplona
ID: 18036915
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
 

Author Comment

by:pawankk
ID: 18043714
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
 
LVL 3

Expert Comment

by:aplona
ID: 18045341
yes that will work.  Thats the same liine I have always used.
0
 
LVL 3

Expert Comment

by:aplona
ID: 18045347
I don't know about that error though.  I have been using this script for years and never had problems.
0
 

Author Comment

by:pawankk
ID: 18058973
aplona any solution ofr this error
0
 
LVL 3

Expert Comment

by:aplona
ID: 18061096
Does this happen on every computer?  If it does then try to recreate the printer
0
 

Author Comment

by:pawankk
ID: 18068277
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
 
LVL 3

Expert Comment

by:aplona
ID: 18069076
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
 

Author Comment

by:pawankk
ID: 18084979
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
nexus filter logs 3 45
Reccomended programming language for client-server applications 12 100
Trouble enabling network for Hyper-V client 10 35
VPN Connection WIndows 10 5 44
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question