Go Premium for a chance to win a PS4. Enter to Win

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

Logon Script on Laptop

I apologize in advance for the length of this post but I tried to provide all relevant information.

The Scenario:
=============
Windows Server 2003 Standard Edition.
Windows 7 Pro running on a laptop.
Drive mapping accomplished with logon script configured in group policy.
Logon script called using launchapp.wsf in order to avoid the elevated token issue introduced with UAC.

We've used this logon script configuration with many clients in mixed environments (Server 2003/2008, Windows XP/Vista/7) without any issues.  As a side note, launchapp.wsf includes code to differentiate between XP and Vista/7 as well as elevated/non-elevated users. (Thanks to Michael Murgolo: http://blogs.technet.com/b/elevationpowertoys/archive/2010/05/25/uac-logon-scripts-and-the-launchapp-wsf-workaround.aspx)

The Problem:
============
One of our clients informed us that network drives were missing.  We've narrowed it down to the scheduled task created by launchapp.wsf - it will not run on a laptop if the laptop is running on batteries.  We could manually change that setting in the task but the task will get overwritten by launchapp.wsf at the next logon so there's no point.

We've thought of a couple of options but haven't had any luck in determining if they are even possible.  If anyone could help out, I'd greatly appreciate it:

Option 1:
=========
Include the setting for the task to run despite laptop running on batteries when launchapp.wsf creates the task.  However, there doesn't appear to be a command line switch for task power options, so there doesn't seem to be a way to do this.

Option 2:
=========
Use group policy (or local policy on the laptop) to change the default settings used when tasks are created but in 2003 group policy, the task scheduler settings don't include power options.

Option 3:
=========
Tell the user to plug-in before loging on.  We've done this but we know there will be times that they forget.

As a work-around, we've placed a shortcut to the script on their desktop for them to run if they don't see any network drives after logging on.

Again, sorry for the lengthy post.  If anyone has encountered this problem and has a solution, please let me know.

Thanks in advance.
0
Sabbec
Asked:
Sabbec
  • 5
  • 2
  • 2
  • +1
2 Solutions
 
ccnsCommented:
im guessing you have tried putting the login script in the login script area in users AD user account and that doesnt work which is why you are using group policy?
as it will map the drives no matter what
0
 
SabbecAuthor Commented:
Thanks for suggesting that option - I thought of earlier today but haven't had a chance to try it.  We generally prefer to use group policy because we've found that it's easier to manage as users change roles in an organization because we can move them to different OUs to have their logon change rather than modifying individual user accounts.  My plan is to make that change before the user logs in tomorrow morning (they're offsite today).  I will let you know if it works.
0
 
APNFSSCCommented:
I think you need to alter the Launchapp.wsf file so that it set's the battery settings when creating the new task

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_26298859.html

0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
Donald StewartNetwork AdministratorCommented:
Have you considered scrapping logon scripts altogether and using Group Policy Preferences ?


GP Preferences Will Reduce Logon Scripts : Mapping Drives


http://blogs.technet.com/b/grouppolicy/archive/2009/02/11/gp-preferences-will-reduce-logon-scripts-mapping-drives.aspx
0
 
ccnsCommented:
also you could put in two scripts into group policy. one with specific mapped drives only and then one with the other stuff.
0
 
SabbecAuthor Commented:
ccns:
I opted to not put the script in the user's account so that I can try APNFSSC's suggestion.

APNFSSC:
This looks like what I needed!  I tried this change in our sandbox environment and it worked perfectly so I put it on the production server (made a temporary OU with the change so I can test for one end-user).  That person won't be trying it for a few hours but I'll let you know the results.

dstewartjr:
Correct me if I'm wrong but GP Preferences are only available in Server 2008 and this is Server 2003.
0
 
Donald StewartNetwork AdministratorCommented:
You are wrong :)

All you need is one Vista/Windows 7 on the network. You then install RSAT on the Vista/Windows 7.

Next You install CLient Side Extensions on your XP/Server 2003 clients <<< you can deploy these with WSUS

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e60b5c8f-d7dc-4b27-a261-247ce3f6c4f8&displaylang=en
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=bfe775f9-5c34-44d0-8a94-44e47db35add&displaylang=en

Now you can use the new group policies that come with 2008 on your 2003 network
0
 
SabbecAuthor Commented:
Sorry for the delay in responding.  I'm still waiting to hear back from the client as to whether it worked.  (They're bogged down with RRSP season but the deadline is today.)

The changes I made are based on APNFSSC's solution - I'm pretty confident they'll work but I want to have client confirmation before awarding points.

A side note to dstewartjr:
Thanks for the information!  I'm going to try implementing this internally before rolling it out to a client.
0
 
SabbecAuthor Commented:
I still haven't been able to reach the client so I'm going to award points anyway because I'm confident that APNFSSC's solution will work.  I'm also going to award points to dstewartjr for setting me straight on GP Preferences in 2003.
0
 
SabbecAuthor Commented:
I forgot to upload the revised script.  Since I can't upload a .wsf file, it's named launchapp..txt file.  Just rename it to launchapp.wsf to use it. Launchapp.txt
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

  • 5
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now