Learn how to a build a cloud-first strategyRegister Now

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

how to skip GPO scripts if not connected to Domain ?

Hi all,

I need to know :
1)  How to stop the GPO scripts not to run on those laptops which not connected to domain , and only run GPO scripts when they are connected to Domain.
background info:
client : Windows XP Pro SP3
Active Directory : Windows 2008 domain
reason: when users logon to their laptops and if they are on the road (offline) , it takes a very long time to contact Domain controllers to process GPO scripts, the startup scripts just sits there and eventually time out.
2) How to stop the GPO settings for Folder redirection not to try to map "my document" to the home share on the server if the users are logging on offline (out on the road)

thanks
0
gsawan
Asked:
gsawan
  • 2
1 Solution
 
BobintheNocCommented:
The normal behavior here, especially for the My Documents redirection, should be acceptable and not too noticeable.  Do you have your domain policy set to enabled on: Interactive logon: Require Domain Controller authentication to unlock?  This will definitely be slower when on the network, and will prevent logon when the domain is not reachable.

Also, processing logon scripts synchronously prevents explorer from launching until after scripts are completed, be sure this is not enabled: Run logon scripts synchronously.

These are both located in the computer portion of a policy, under:
Security Settings...Local Policies...Security Options...Interactive logon: Require Domain Controller authentication to unlock  
 and
Administrative Templates...System...Scripts:Run logon scripts synchronously and Run Startup Script Asynchronously should be enabled to allow all scripts to run simultaneously instead of waiting for one script to complete before moving onto the next script.

For troubleshooting your scripts to see if they ARE hanging up indefinitely, turn on the policy:  Run Startup scripts visible  so that you can see the script during logon in a cmd window.  Otherwise, they process in the background and you can see them.

One more policy allows you to set the time for total script run time, and if it exceeds the time set, it'll force continue/exit of the remaing scripts, allowing the rest of the logon to take place.  This default value of 10 minutes is a bit long, but don't adjust to less than a minute or so, to make sure your scripts, in normal fashion, can complete when domain connected:  Maximum wait time for Group Policy scripts.

I don't believe that the scripts that are applied to the computer or user from a gpo are processed though, unless you ARE connected to a domain.

0
 
BobintheNocCommented:
There are also user based settings for script visibility, synchronous and async modes, etc.,
0
 
gsawanAuthor Commented:
Hi BobintheNoc!
thanks for your response, i am checking the settings now and back here for the update
0
 
FarWestCommented:
you can try to check logon type on scripts stratup, and if it is cached then you can skip any commands that are not required (or all commands)

Set colSessions = objWMI.ExecQuery _
              ("Select * from Win32_LogonSession Where LogonType = 11")


Logon Type 0 = System Only
 Logon Type 1 = unknown
 Logon Type 2 = Interactive Logon
 Logon Type 3 = Network
 Logon Type 4 = Batch
 Logon Type 5 = Service
 Logon Type 6 = (proxy logon)
 Logon Type 7 = Unlock Workstation
 Logon Type 8 = Network Clear Text
 Logon Type 9 = New Credentials
 Logon Type 10 = Remote Interactive (Windows XP and newer operating systems only).
 Logon Type 11 = Cached Interactive
 Logon Type 12 = CachedRemoteInteractive
 Logon Type 13 = CachedUnlock

good luck
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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