Another Logon Script Problem

  • Thread starter jonny813
  • https://www.osnn.net/admin.php?templates/thread_view.1970/delete&_xfRedirect=https%3A%2F%2Fwww.osnn.net%2Fadmin.php%3Ftemplates%2Foutdated Start date

jonny813

OSNN Addict
Joined
1 Dec 2006
Messages
88
Ive just been messing around with Windows Server 2003 with group policy etc. and was wonderin how to make both a network connection to the users documents and a shared area appear in My Computer as network drives when the user logs on. Curently I have to do it manually when I logon using Tools>Map Network Drive etc. Would this require a logon script or how could I achieve this? Is there any eaxmples as well that i could work off since i have no experience with script writing
 

fitz

Woah.. I'm still here?
Political Access
Joined
26 Apr 2004
Messages
4,084
and yes, you can write up that batch file and make it a logon script to map the drive at each login (assuming they are connected to the domain when they login with their domain account)
 

jonny813

OSNN Addict
Joined
1 Dec 2006
Messages
88
Thanks for that kcnychief and fitz, will try when i get home from school. Why couldnt Help and Support put it like that?
 

kcnychief

??? ??? ?
Political Access
Joined
8 Apr 2005
Messages
16,950
Login scrips go in C:\WINDOWS\SYSVOL\sysvol\domain_name\scripts

They also need to be added to the AD Profile as well
 

jonny813

OSNN Addict
Joined
1 Dec 2006
Messages
88
Thnx got it working (rep to be added) now finally I got this sample script from MS for adding a printer connection and assinging a default printer. I myself cant get much from it so can someone show me where i put my unique information in to allow it to work? They look like this:

Add printer connection:

Set WshNetwork = CreateObject("WScript.Network")

WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Xerox300"
WshNetwork.SetDefaultPrinter "\\PrintServer1\Xerox300"

Set default printer:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Name = 'ScriptedPrinter'")

For Each objPrinter in colInstalledPrinters
objPrinter.SetDefaultPrinter()

Also, MS said that the printer connection has to be run locally on the computer, how can I make this happen. I know I should get a book but I have no money lol thnx for any help
 

fitz

Woah.. I'm still here?
Political Access
Joined
26 Apr 2004
Messages
4,084
I know I should get a book but I have no money lol thnx for any help
You don't necessary need a book. There is a wealth of scripting info out on the web if you take the time to learn and understand what you copy/write. But given your apparent lack of experience administering a network, I would probably suggest a good class to start with. Spend a little money for class now, or spend a lot of time/money/headache later when you screw something up because you don't know what you are doing.

Thnx got it working (rep to be added) now finally I got this sample script from MS for adding a printer connection and assinging a default printer. I myself cant get much from it so can someone show me where i put my unique information in to allow it to work? They look like this:
I'm going to hack this up a bit..

Add printer connection:
Code:
dim strPrintPath 

'add the UNC path to the printer here
strPrintPath= \\printServer\printerShareName

'creates the object
Set WshNetwork = CreateObject("WScript.Network")

'adds the printer connection
WshNetwork.AddWindowsPrinterConnection strPrintPath

'sets the default printer
WshNetwork.SetDefaultPrinter strPrintPath

Set default printer:

Umm.. the script above already set the default printer.

Also, MS said that the printer connection has to be run locally on the computer, how can I make this happen.
Logon scripts execute locally on the computer.
 

jonny813

OSNN Addict
Joined
1 Dec 2006
Messages
88
Thanks for that, actually got it working at home last night but dont have internet access at home at the minute so couldnt have said, good ive got them all working now, thnx
 

Members online

No members online now.

Latest forum posts

Latest profile posts

Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?

Forum statistics

Threads
62,002
Messages
673,449
Members
5,596
Latest member
Joshua Liansky