Do not use on any
shared computer
August 29, 2008 07:01pm pdt
 
[x]
Attachment Details

AD, Logon Script, Windows XP, Windows 2003, Login Script, VBScript

Tags: VBScript, Active Directory Logon Script
I have just built a new File/Printer server.  Currently we do not have any logon scripts in place.  I would like to create a new logon script that does the following.  I have found bits n' pieces that do different portions of this across the net but none that really cover all the bases.  I know very little about VBScript but i'm not a complete moron when it comes to programming (more of a php guy).  So even a shell of the script necessary should point me in the right direction.

1. Check if old shared printer(s) exists.
   a.  If they do.. remove them.  If not continue...
2. Check if new shared printer(s) exist
   a.  If they do.. skip.. If not, add them.
3.  Check if G: and I: currently map to \\OLDSERVER\Shared and \\OLDSERVER\Users
   a.  If they do, remap them to \\NEWSERVER\Shared and \\NEWSERVER\Users
   b.  If the drive letter G: or I: do not exist at all map them to \\NEWSERVER\Shared and \\NEWSERVER\Users.

and lastly.. but not necessary.. more of acuriousity thing.. is there anyway to uninstall software via a logon script vs a gpo?  I'd like to uninstall the current version of AntiVirus (McAfee) on each users logon as later on in the week i'll be installing (by hand most likely.. or maybe silent install via logon script) the new version.  Like I said.. this question isn't really necessary as its not exactly on topic, but more out of curriousity.

Thanks!
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Programming
Question Asked By: ZooyorQ
Solution Provided By: Shift-3
Participating Experts: 2
Solution Grade: A
Views: 456
Translate:
Loading Advertisement...
 
[+][-]Accepted Solution by Shift-3

Rank: Guru

Accepted Solution by Shift-3:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by weellio

Rank: Guru

Expert Comment by weellio:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Open Discussion
Open Discussion
 
Comment by ZooyorQ
Worked perfectly.. my only problem now is trying to get the stupid printer drivers (this is a win2k8 ad controller) for X86 to work.  It keeps rejecting every x86 printer driver I try to add as "additional drivers".  I've tried PCL5,6, Universal PCL5, 6, etc.. All the printers are HP.  :\  

Your solution was spot on! Thanks a ton.

As a side note, I also used your suggestion of using the GUID and MSIEXEC to uninstall the McAfee AntiVirus and that worked perfectly as well.  

I had to use KIXTART to call "shell msiexec etc..etc.." becuase i wasn't sure how to do it in VBScript. :\
 
 
Comment by weellio
strprogram = "msiexec /x {guid}"
CreateObject("Wscript.Shell").Run """" & strprogram & """", 0, False
 
 
20080723-EE-VQP-34 / EE_QW_2_20070628