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

x
?
Solved

Logon Scripts don't run

Posted on 2009-05-06
4
Medium Priority
?
754 Views
Last Modified: 2012-05-06
I have a logon.bat file containing the following:

REM NETWORK SCRIPT
net time \\<dc ip address> /set /y
net use U: \\<server>\u$

The file is saved in the NETLOGON folder of my DC.  Under my user profile in AD for Logon Script: logon.bat

I had this working but now it's stopped for some reason any idea?

If I browse to the NETLOGON folder and execute the batch file it runs and maps the drive.  I've tried this with 2 different user accounts and 2 different machines.
0
Comment
Question by:sharkbot221984
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:debuggerau
ID: 24320932
If you log out immediately and then log in straight away, does the script run the second time?
0
 
LVL 8

Author Comment

by:sharkbot221984
ID: 24321079
No it didn't, but I got it fixed already here's what happened:

I was setting up a 2nd script called logon_sales.bat, I was also having issues with this one.  On MY user account I wanted logon.bat to run and it would only run on logon if in AD I called it just plain logon (no .bat), the 2nd script called logon_sales.bat would only run if in AD I called it logon_sales.bat, but in NETLOGON both scripts are shown as just logon and logon_sales, but are recognized as batch files anyways.  IF you add the .bat to them in NETLOGON so they appear as logon.bat and logon_sales.bat then you go to Start -> Run and type \\server\NETLOGON\ they show up as logon.bat.bat and long_sales.bat.bat  I'm guessing NETLOGON assumes what you put in the is going to a Batch file?
0
 
LVL 23

Accepted Solution

by:
debuggerau earned 2000 total points
ID: 24321498
yes, I set my machines to have system and hidden files shown, as well as displaying system files and dont hide extensions.

Windows Explorer -> Tools -> Folder Options -> View tab.

P.S. I use .cmd for scripts also.
0
 
LVL 8

Author Closing Comment

by:sharkbot221984
ID: 31578783
Thanks, I usually set my machines to not hide extensions, just inherited this machine and it wasn't setup that way and haven't done it yet.  Thanks for the reminder!
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question