Home > General > Logon.vbs


Type Login Script. IT & Tech Careers Currently I am a web developer with a BS in Computer Science, I do not have any certs as of yet. The best environment would be Windows Server 2003 with an XP client. MoveTo Folder takes care of that for you. [edit] CopyTo & MoveTo Folder '===================================== ' Copy To Folder '===================================== On Error Resume Next Dim ctmtpath ctmtpath = "HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\" WSHShell.RegWrite ctmtpath,"CopyTo" WSHShell.RegWrite

My share name and server are the same as example 1, '\home' and '\\alan'. See more about assigning PowerShell logon scripts. Email Reset Password Cancel Need to recover your Spiceworks IT Desktop password? Printer scripts employ a variety of different methods; in this instance, we concentrate on AddWindowsPrinterConnection. http://www.computerperformance.co.uk/Logon/logon_scripts.htm

If you stick with me, you will see that I love variables. Go for Guy's eBook - and get a printable version with copy enabled and noexpiry date. Read these next...

Think of all the frustration that this free utility saves when you are troubleshooting authorization problems for users access to a resource. In Windows Server 2008 you can launch the Group Policy Management Console and configure Drive Maps by clicking with a mouse. OK, first copy the text and put it into notepad. I wanted to give you three variations of the MapNetworkDrive method, so that you could decide which features to include in your logon script.

If you are still using batch files, it is time for you to move ahead and see what vbscript can do for you. The idea is to reduce spelling mistakes.Note 2: One reason that I like to employ variables is to make it easier to troubleshoot in general and display messages with WScript.Echo in However, with printer scripts, it's often the result of 'over think', so begin with simple plan and pay attention to the syntax. Change the server name from "\\zara to the name of your print server.Create a shared printer and use that name in place of \HP LaserJet in my script.

You won't need them and they only beef up the size of your GPO which slows down replication. While PowerShell is used mainly for configuring the operating system, it's possible to its cmdlets to MapNetworkDrive. This is the same basic script as example 1 and 2. We create a network object, objNetwork, apply the AddWindowsPrinterConnection method and then assign the value of your shared network printer.Note 4: I deliberately made Example 1 as short as possible so

Join the IT Network or Login. https://community.spiceworks.com/scripts/show/1024-logon-vbs See more on Group Policy Drive Maps. However, the hard part is executing this .ps1 file as a logon script. I strive for nothing less than 10s.

Dim smpath smpath = "HKCU\Control Panel\Desktop\" 'the following line will REQUIRE a click in the start menu '===================================== WSHShell.RegWrite smpath & "MenuShowDelay","65535","REG_SZ" 'the following line will reverse what this Add On Therefore go to Line 2 of my script and change the name of the server from '\\alan' to the name of your server. However, to practice MapNetworkDrive scripts, you could create a share on your own desktop computer. Instructions for a Windows 9x Printer Logon ScriptCopy and paste the script below into notepad.

This is the simplest way to have a script for each user, but requires assigning a script for each user individually. Not a member? Read these next... Tuesday, April 12, 2011 4:46 PM Reply | Quote 0 Sign in to vote Since you have 2008 you could use Group Policy Preferences and there is a nice easy interface

Users passwords Run basic functions such as CreateObject and GetObject Modify environment variables e.g. This works great if the user has only a single local printer, but if they have more than one, for example Adobe PDF Writer then you may not get the results One perennial problem I have with scripting is paying attention to detail, especially the syntax.

Case "ADMIN" WSHNetwork.MapNetworkDrive "w:", "\\Server\Admin Stuff",True Case "WORKERB" WSHNetwork.MapNetworkDrive "w:", "\\Server\Shared Documents",True 'Below is an example of how to set the default printer WSHNetwork.SetDefaultPrinter "\\ServerName\PrinterName" End Select Next 'Remove ALL old

This FAQ covers a lot of ground but is not intended to be the answer to ALL scripting needs. Description One script for all users The script on it's own will delete any map drives and map any generally applied shared drives. Click the Edit button. I will show you how to write a logon script in VBS using the AddWindowsPrinterConnection method.

Even with a simple letter - J, we must be careful. Download a free trial of Solarwinds' Network Performance Monitor Example of a Logon ScriptVBScript to map a network drive. The limiting factor is that the newer GPP may only be edited from a Vista or 2008 box... On Line 10 change the server name from '\\alan' to your server name.

So here is the situation. You responded in true SpiceHead style... Download your free Network Device Monitor Guy's Review of Computer Tools 1) Belarc Advisor 2) Network Perf Mon 3) Freeping 4) PuTTY 5) Bandwidth Analyzer 6) Secunia 7) Net-SNMP 8) Permission Is high education worth it for a programmer?

For Each GroupObj In UserObj.Groups 'Force upper case comparison of the group names, otherwise this is case sensitive. Save the file with .vbs extension e.g. Almost anything is possible. All rights reserved.Newsletter|Contact Us|Privacy Statement|Terms of Use|Trademarks|Site Feedback ERROR The requested URL could not be retrieved The following error was encountered while trying to retrieve the URL: Connection to