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,
casscarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nick RhodeIT DirectorCommented:
0
arnoldCommented:
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.
0
casscarAuthor Commented:
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.
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

arnoldCommented:
support tools, have a sleep command that you can use sleep 120 to delay processing by two minutes.
0
lindentoCommented:
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.
0
casscarAuthor Commented:
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...
0
lindentoCommented:
Hi,

i don't know of a way to access AD properties in batch files.

i would take to full unc path to the script and do a call in the batch file

call \\SERVER\NETLOGON\%USERNAME%.bat

Best regards
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
casscarAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.