Solved

Sharing printer on Domain

Posted on 2006-11-05
21
1,102 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
 

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
Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

 

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

Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Join & Write a Comment

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now