Link to home
Start Free TrialLog in
Avatar of HAC_ITS
HAC_ITSFlag for United States of America

asked on

User Profile Login Script section in Active Directory?

This is actually a two piece question.  One is it possible to run more than one batch file/script in the User Profile: Login Script in Active Directory, or am I limited to one script per user (in the case I already have a script set in the User Profile: Login Script)?  

Second is it possible to assign a script to a Security Group?  Reason being is I have several OUs for separate departments (which I have scripts set in the GP for each department, mostly mapped drives) but have a Security Groups for Committees/Groups that span across several of these departments.  What I would like to do is set up a script to map shortcuts to shared folders for sharing their committee/group data.  Any help is welcome.  

Last thing, I've read in order to right a script to set up a shortcut you actually have to create the shortcut first , then copy that shortcut to the location you want on their computer?  Just a quick example of what I would like to do:

Server folder share path:
D:\Committee Folders\Management Team (Managment Team is shared folder)

What I would like to to create a shortcut to Management Team and place on the members desktop.
So what I would do is create shared folder to hold shorcuts that way the shortcuts aren't located in the shared folder:

D:\Committe Folder Shortcuts\Management Team.lnk (shortcut pointing to the Management Team folder)

Script:
;Delete the mapped drive
net use "T:" /d

;Setup a temp mapped drive for shortcut copy
net use "T:" \\Server\Committtee Folder Shortcuts

;Copy the shortcut if it isn't there
If Not Exist("%Userprofile%\Desktop\Management Team.lnk")
     copy "T:\\Server\Committee Folder Shortcuts\Management Team.lnk"  "%Userprofile%\Desktop"
End IF

;Clean out mapped drive thats not needed
net use "T:" /d

Please let me know if my logic looks right or if anything looks wrong.

Thanks,
Ronnie
Avatar of redseatechnologies
redseatechnologies
Flag of Australia image

that looks like it would work fine

you can get logon scripts to run other scripts - just make the last line point to another script

i have 5 different logon scripts, but only 1 printer script - 4 of the 5 logon scripts calls the printer script at the end

Kix32 works wonders for things like this


I am pretty sure that you can set up a policy which includes a logon script to selected members, but you can't directly make members of a security group run another script

i have now used up the word script, and am banned from typing it anymore

-red

script script script
Avatar of BILJAX
BILJAX

WSH/VBS code works really well in Windows 2000/XP/2003 :)

I will post an example of it tomorrow.


AC
I always recommend using group policy for login scripts vs. doing it on the accounts in AD if you are going to implement a script on a large scale basis. Meaning if you want more than just a couple of people to run the script then using group policy reduces the amount of work involved since you don't have to one by one add the script for each user. And it is so much easier to manage this way in case there needs to be changes made, it needs to be removed, etc.

As far as mapping drives based on security groups.  You of course can't apply group policy direct to security groups. You can filter a policy so that only specific security groups will get the policy. Or you can do this in your script. I'll try to post an example of a vbs script that does this.  I map printers based on security groups using wsh/vbs and it is very simple to do.

I like using wsh and vbs and mentioned by one post above. Its a matter of preference as to what you write your scripts in.....i seem to understand vbs more and feel more comfortable using it.
ASKER CERTIFIED SOLUTION
Avatar of BILJAX
BILJAX

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 HAC_ITS

ASKER

I've just been using batch files (.bat) for scripts so using WSH/VBS would be new to me.  Could you point me in the direction for starting to go that route BILJAX or anyone else.

Thanks,
Ronnie