Link to home
Start Free TrialLog in
Avatar of smartin0924
smartin0924

asked on

Login Script

I am trying to run a installation of Altiris AClient using a batch file.  I want the script to run when the user logs into Windows.  I have created a OU but  I'm not sure how to get the script to run for this OU.  Can someone tell me how to do this as detailed as possible?
ASKER CERTIFIED SOLUTION
Avatar of Pete Long
Pete Long
Flag of United Kingdom of Great Britain and Northern Ireland image

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 smartin0924
smartin0924

ASKER

ok. I have followed the steps and created the GP, but where would i place my batch file in the GP
sorry.  didn't read the last sentence.
Its not working.  I have created a simple .bat file just to see if it would work and nothing happened.  The test was to just open a command window and ping a certain address until I stopped it.  Any Ideas?
Login scripts by default run completely hidden I believe, at least all of mine do when I use them as a GPO Login script.  Try having it make a file on the HD or make some other change you can see other than an interactive window
ok I create a simple bat to just make a folder called test.  Nothing Happened.  I am placing this on the OU just so you know.  Anything else i can try.
So on the OU you have a group policy that has a User Logon script, correct?  You also have a user placed into that OU and you are logging in as that user?
That is correct. I have placed myself in the OU for testing.
Where is the script located? Is it on a shared resource on the network, or when defining a login script, did you press "Show File" and drag you script there?  Then you should click on the Add button and select the script you want to run.  Also verify that your script does what you are requesting of it right now before making it part of the logon.
I have created a video that will show you what I did.  Can you send me your email address and i will send it to you.  It is a .swf file that I created with RoboDemo.  Nothing fancy but it will give you the idea of what i did.
Check my profile to see the e-mail address you can send it to.
Everything looks perfect.  If you run the batch file normally it creates the folder you specified?

Also, if you have more than one domain controller in your environment, you will need to wait 15 or so minutes for everything to replicate across the network.  What is the content of your test batch file?
md c:\testfile

This is all I am trying to do until I get it working.  I'm not sure what is going on with it.
You are logging into the domain from your computer, correct?
SOLUTION
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
Sure that will work Pete?  I have about 6 scripts that run on a typical workstation on my domain, and none of my users see a box for the scripts.  Redirecting the output is how I check to see if they are running.

md "c:\documents and settings\%username%\testfile"
echo login script run at %time% on %date% >> "c:\documents and settings\%username%\testfile"
Not tried in on 2K3 but Ive had an echo command on screen, if your unsure put this in a second batch file and call it from the login script
Why don't you just assign the software to the computers that you want it installed on (especially if its got an MSI package - just ditch the script)

1.  Open Active Directory Users and Computers snap-in and navigate to Active Directory container (domain or organizational unit) that contains the users or computers for which you want to manage software.

2.  Open the Group Policy snap-in to create a new (or edit an existing) Group Policy Object (GPO).

Open the Group Policy snap-in by right-clicking the Accounts OU, select Properties from the context menu, and then in the Accounts Properties dialog box, click the Group Policy tab. Then in the Accounts Property page, click the Group Policy tab, select New and type a name to create a new GPO, or select a GPO form the Group Policy Object Links list box, and click Edit. This opens the Group Policy snap-in.
 
3.  In the Group Policy snap-in, select either the User Configuration or the Computer Configuration node, double-click Software Settings, and then right-click Software Installation. This opens the Software Installation snap-in.

4.  Select Windows Installer package (.msi file) that you want to deploy from the software distribution point.
 
5.  Configure the software for management (associate any transforms and create any upgrade relationships).
 
6.  Assign the software to the computer.

When you assign it to a computer, the software is installed for all the users who use the computer the next time that the computer reboots
 
The file I am trying to push out does not have a .msi  only .exe  I will try the script listed above from PeteLong to see if this is going through. Will let you know.
UGH!!!!!  This is frustrating. This is not working.  Just a simple script and that doesnt even work.  I copied the script from above:

md c:\documents and settings\%username%\testfile
echo login script run at %time% on %date%
echo press any key
pause

Nothing is happening.  Is there anything I need to check to make sure I have my server configured correctly?
You will need quotes around "c:\documents and settings\%username%\testfile" to make it work properly.  I dont' think  the echos will work as you are thinking.
I checked the script and i do have "" around the command.  I took the script and i also placed it on the Domain Policy.  It still did not run the script.  I know the Default Domain Policy is working because I changed a setting within the policy to remove the Run command from the start menu.  So i know the policy is being pushed out but the script is not running.
You could try putting something like

net send mycomputer The script ran

replacing mycomputer with your computer name so it sends you a net send message to let you know it is working.  I assume you are logging in as an administrator that has permissions to create a folder?
I tried the net send computername "The script work!!!"   Nothing is happening.   I know XP creates a profile for users.  Is it possible that the profile is not actually going to the domain to authenticate but just going off of the local cached profile?
If you have restarted the computer recently then all should be good.  Is this a Win2k or WinXP machine?  If it is an XP machine, then go to the command prompt and type
gpupdate
to pull the latest group policy to the computer. You could also restart it just for good measure.  Make sure when you log in that you are logging into the domain.
I restart my machine everytime I make a change to the policy. Just to make sure.  I am logging into the domain. I have no clue what to try next.
Is there a way to run a command to make sure it is recognizing me in the group I am assigned to?  I created a test OU and placed myself in this group.  I want to make sure that it is recognizing me in this group.
You could try making a goofy GPO setting, like no screensaver tab and check if that takes affect when you log in.
SOLUTION
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
Well, I finally got it to work.  Heres what I did.  I deleted all of GPO.  I only had one in place so it was not a big deal.  If i navigated to WinNT/Sysvol/sysvol/Policies I noticed i had several different folders pointing to other GPO's that use to exist.  I deleted all of them except for the Default Domain Policy.  I then created one GPO and placed my script within that GPO.  It fired off without any problems.  I split the point among the three of you for helping me out and pointing me in directions that helped me come to my answer.  Thanks for your help.  It finally works.
ThanQ