I need a script to load a file based on a AD group and OS

May 14, 2012 at 10:30:17
Specs: Windows 7
I have 3 groups of users that will need one of three different templates installed based on what security group in AD they belong to and the location of the file based on what OS Windows 7 x64 or XP 32 bit. I would like to do this via a Group Policy logon batch file if possible. I think I have the part that will look for the OS version but I don't have the part that will look for if the user belongs to AD group X then copy file Y.

See More: I need a script to load a file based on a AD group and OS

Report •


#1
May 15, 2012 at 07:08:53
You can get a users group membership with whoami /all. Parse that with a for /f loop with find or findstr. For checking x86 vs x64, I usually check the value of %processor_architecture%.

Tony


Report •

#2
May 15, 2012 at 09:13:11
Thanks Tony, I am looking to see if I can have a batch file that states If member of Group A then go to OS-1 and under the OS-1 I would check if Windows 7 then copy file A to this location if XP copy file to this location, If member of Group B then go to OS-2 and under the OS-2 I would check if Windows 7 copy file B to this location if XP copy file to this location, If member of Group C then go to OS-3 and under the OS-3 I would check if Windows 7 copy file B to this location if XP copy file to this location.

Report •

Related Solutions


Ask Question