Link to home
Start Free TrialLog in
Avatar of casscar
casscar

asked on

Delay logon script

Hi all,

I need to create a specific batch file that does the following.

Pings an IP for 120 seconds
After the timeout it checks with which username I am logged in and it contacts the Domain Controller and gets the logon script dedicated to that user from the field “scriptpath” from the AD properties and runs that logon script dedicated for that particular user.

All this is needed since we have a particular security software installed and we need this workaround. This software disconnects the network on start-up for 2 minutes and logs in with a cached password. After the 2 minutes we would like to run the logon script so that it maps the mapped drives for the user. The first batch file will be placed in the start-up folder of each machine.

I cannot use local GPO or Server GPO since on startup there will be no connectivity to the domain but just after 2 minutes.

Can you please assist?

Regards,
Avatar of Nick Rhode
Nick Rhode
Flag of United States of America image

Avatar of arnold
There is a GPO that you can set the requirement that the network connection be established before user login is available.
This will auto delay any login attempt until the network is established.
Avatar of casscar
casscar

ASKER

The problem is that with this program (it installs an Access List) on your network card and it just allows traffic to a specific port so therefore to connectivity to the domain is allowed. Connectivity/ports/traffic to the domain is allowed after 2 minutes. That is why i would like to create a local batch file on each machine and after 2 minutes it talks to the domain controller and gets the login script of that particular user.
support tools, have a sleep command that you can use sleep 120 to delay processing by two minutes.
ping 1.1.1.1 -w 120000 -n 1

would make ping wait for 120s before continuing the script.

If that's the way you want to go.
Avatar of casscar

ASKER

Thanks i will use that command (ping 1.1.1.1 -w 120000 -n 1) but after it has ping for 120 seconds how can i call to get the user's logon script? That is set in the Active Directory?  Was thinking of something like %username%logonscript...
ASKER CERTIFIED SOLUTION
Avatar of lindento
lindento

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of casscar

ASKER

Thanks