[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 787
  • Last Modified:

Can I make login script actions hidden

I set up a login script .bat file to map network drives and install some shared printers because the users keep deleting them. It works but as the user logs in they see the CMD window and then it opens each printer's Window (not sure what its called I attached a screen shot) Then it dissappears. Now they're complaining they don't want to see this. Is there any way to get the script to work yet not display anything on their screens just map the drives and printers in the backgound
printer.doc.docx
0
Axis52401
Asked:
Axis52401
1 Solution
 
Trenton KnewCommented:
Are you able to make the script run as the system account?  Maybe use the task scheduler ...  checkout

SCHTASKS /?
SCHTASKS /Create /?
SCHTASKS /Run /?

There is also a group policy for running tasks silently I think.  Maybe create and run task as system account during logon?
0
 
Mike KlineCommented:
Test this GPO

User Configuration | Administrative Templates | System | Scripts

GPO = Run legacy logon scripts hidden

Have you looked at group policy preferences for some of this?  Just for down the road.

Thanks

Mike
0
 
Axis52401Security AnalystAuthor Commented:
What do you mean by make the script run as the system account? I have a/bat file on the server Sysvol\domain etc and in the user profile it set to use that file. I don't want to have to go to each station an create a task on each PC

I Tried that setting in the GP either I did it wrong or Its not applying because after running gpupdate on the test PC i'm using I still see the cmd window and printer popups. If I could even get the login script batch file to skip everything if its already mapped that might work too but I don't know the dos commands to do that. that way it would only happen once for each user not every time
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
Trenton KnewCommented:
might also be an idea to recreate the printers at logoff instead of logon.  That way the printers dialog never becomes an issue as the machine "preps" itself for the next user when the last user logs off.

There might also be a group policy setting that disallows the deletion of printers.
0
 
Trenton KnewCommented:
if you run the .bat file via the task scheduler, you can specify which user account to run the script as.  If you run the script under NT_AUTHORITY\SYSTEM the user will not see the bat file run, nor will the printer window pop up (I think).
0
 
Axis52401Security AnalystAuthor Commented:
How do I set it to run via the task scheduler? Its worth a try
0
 
SandeshdubeyCommented:
Try this vbs script and apply the logon policy to map the drive.I have applied many times this does not prompt for printer windows.Save the file as filename.vbs,copy the file to sysvol share(script folder) and apply the logon policy.


Dim multiPrinter, UNCpath1, UNCpath2, UNCpath3, UNCpath4, UNCpath5
UNCpath1 = "\\server01\printer1"
UNCpath2 = "\\server01\printer2"
UNCpath3 = "\\server01\printer3"
UNCpath4 = "\\server01\pinter4"
UNCpath5 = "\\server01\printer4"
Set multiPrinter = CreateObject("WScript.Network")
multiPrinter.AddWindowsPrinterConnection UNCpath1
multiPrinter.AddWindowsPrinterConnection UNCpath2
multiPrinter.AddWindowsPrinterConnection UNCpath3
multiPrinter.AddWindowsPrinterConnection UNCpath4
multiPrinter.AddWindowsPrinterConnection UNCpath5
multiPrinter.SetDefaultPrinter UNCpath1
WScript.Quit

Alternately you can apply  GP Preferences to map printer but for WinXP you need to install Client Side Extensions for Windows XPhttp://www.microsoft.com/en-in/download/details.aspx?id=3628: http://blogs.technet.com for policy to work:

 GP Preferences to map printer ;http://blogs.technet.com/b/grouppolicy/archive/2009/06/24/gp-preferences-set-a-default-printer.aspx
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now