|
|
|||||||
I am finding difficulties in getting this script to run successfuly. I want a different drive to be map for users depending on the group they belong to in the domain so i write this simple code but it does not work at all. Below is the script IF INGROUP("ITDEPT") USE T: "\\SERVER1\APPS" ELSE IF INGROUP("FINANCE") USE P: "\\SERVER3\ACCOUNTS" ELSE IF INGROUP("SURPAC USERS") USE G: "\\SERVER9\DATA" ELSE ENDIF BUT when a user in one of these groups logs on to the domain, he does not get the map drive. Hope somebody can really help me to sort this please Regards Edmund |
||||||||
|
|
|||||||
structure is IF something ELSE something else ENDIF So you might wanna do: Code:
If you wanna use ELSE, it should in this case be used something like this: Code:
This makes it that if you're in the group SURPAC USERS, g: gets mapped to \\server9\data, and if you're not in the group, it mappes something else to G: in this example. |
||||||||
|
|
|||||||
i just try it again with what you written above but it still does not map the drive at all. |
||||||||
|
|
|||||||
Mkay.. First of, is the user in the group, etc etc? second, try this: Code:
Second, is the drives already mapped? |
||||||||
|
|
|||||||
If you need to do more than one comparison, Select - Case - EndSelect, is a much better way to do it. Code:
You may want to also look at what the errors are thereby giving you an idea why they are not mapping Code:
|
||||||||
|
|
|||||||
Garg, what is a user is in two groups / all the groups ? second, I prefer @SERROR - looking thro the error-codes isn't really my style ;P |
||||||||
|
|
|||||||
Details, details, what do you want... And yes @Serror is a good way to go as well |
||||||||
|
|
|||||||
The drives are not already mapped and i just don't know what is happening here. I tried again with the above script and nothing happen. I am totally confused. |
||||||||
|
|
|||||||
then lets start with how you're calling the script ? both during logon and now. |
||||||||
|
|
|||||||
I will appreciate that very much b'cos when i tried using the kixtart last yr i had no succss in the normal inplementation so then i have to create a kix file like financ.kix and place this cmd kix32.exe finance.kix in each of the finance users profile under the user properties. That is really a tidious job to do so if i can get the normal way for kixtart to work, i will be very very grateful please. |
||||||||
|
|
|||||||
well, I would appreciate if you provided the info I asked for so we can help you Ways to start and execute kixtart-scripts during logons can be found in the faq-section otherwise ( a bit too much to bluur out here..;) ) |
||||||||
|
|
|||||||
What type of domain are you implementing KiX in? How are you calling your script now..? When testing your script how are you calling it? |
||||||||
|
|
|||||||
ok, i am implementing kix on a windows 2003 server platform. The script is being run by placing this comand "kix32.exe surpac.kix" in the users properties profile. That is exactly what i am doing now. so please help me get off this tidious job. |
||||||||
|
|
|||||||
mkay, good start. But, that's not the way to call it. Check this out: How to run kixtart In case the link is broken, the thread you're looking for is under FAQ-section, titled 'Use of %0\..\ to launch KiX '. Basically, in the userprofile-tab, use logon.bat or something like that. In your logon.bat (placed on the notlogon-share), you call the script. |
||||||||
|
|
|||||||
Quote: I would think this is OK if you just have Windows NT (and higher) Workstations, no Win9x. I think another approach is GPO. Create GPO on OU with the users that need a certain script. Go to User Configuration --> Windows Settings --> Scripts (Logon/Logoff) --> Logon Ad a new script, the "script name" is wkix32.exe, the "script parameters" is your script file. Do not forget to copy the files in the policiy directory (You can open a browser clicking the "Show Files" button in the "Logon Properties" Window). |
||||||||
|
|
|||||||
Witto, you sure about that? I've personally never seen it working (using kix kixscript.kix from the users profile-tab) - will have to try tho. |
||||||||
|
|
|||||||
You see what i want to avoid is putting the command in users profile b'cos that is really tidious and if i can implement it with only script in the sysvol then that will be very easy. |
||||||||
|
|
|||||||
You could make a master script that calls the other scripts based on the user, a group, a site or whatever you need. If you put the master script in the users profile then changes would only have to be made in on place being the master script when a script for a new department, a new site, etc... is added. |
||||||||
|
|
|||||||
I really belive you need to check out the FAQ-section on how to set it up. |
||||||||
|
|
|||||||
I am going through the FAQ-section to get the set up from stratch to see how it goes this time. |
||||||||
|
|
|||||||
Post if you need help / found the issue so the community can benefit from your findings |
||||||||
|
|
|||||||
I have done a lot but i'm getting very disappointed.This is what i did. i place the kix32.exe file, a logon.kix and a batch file logon.bat files all in the Sysvol folder in the WINDOWS\SYSVOL\sysvol\domain.com\scripts. Now in inside the logon.kix i have IF Ingroup ("itdept") use x: /DEL /PERSISTENT use Y: /DEL /PERSISTENT use x: "\\servername\surpacdata use y: "\\servername\department EndIf Then within the batch file i have this: kix32.exe logon.kix. And in GPO under user configuration/windows settings/scripts/logon i have addeded the batch file logon.bat. But still it does not work at all for me. Wondering what the hell is playing up with me. looks like this might not work for me. any help |
||||||||
|
|
|||||||
Small chance but what happens when you put the domain name in front of the group so you would get \\domain\group? |
||||||||
|
|
|||||||
I place the domain in as IF Ingroup ("domain\itdept") and still doen't work. |
||||||||
|
|
|||||||
Please try something like this for a test account. Code: If Not @LogonMode |
||||||||
|
|
|||||||
You are missing quotes. |
||||||||
|
|
|||||||
Quote: Further to what Les was saying about your missing quotes: Code:
HTH, Kent |
||||||||
|
|
|||||||
sorry on the actuall scripts i have both quotes on which didn't work. NTDOC, i tried with your codes which i was expecting to see either 'Found in ITDEPT Group' or not but i don't c anything at all. i am wondering what i might be doing wrong or what is preventing the script to run. |
||||||||
|
|
|||||||
Hi Edmund, Well how are you calling the script? What Server Domain model? Active Directory or NT4? Are you sure that all your servers have replication working correctly? Are you running any Windows 9x clients? If only NT/2000/XP clients then you don't need a batch file to call KIX32 and your script. |
||||||||
|
|
|||||||
NTDOC, I AM RUNING 2003 SERVER DOMAIN WITH ACTIVE DIRECTORY AND HAVE REPLICATION WORKING FINE B'COS MY DFS HAS BEING AND STILL DOING FINE AS WELL AS DC REPLICATIONS.ALL CLIENTS ARE XP WITH LESS THAN 10 RUNNING 2000. THIS IS HOW I CALL THE SCRIPT: i place the kix32.exe file, a logon.kix and a batch file logon.bat files all in the Sysvol folder in the WINDOWS\SYSVOL\sysvol\domain.com\scripts. Now in inside the logon.kix i have IF Ingroup ("itdept") use x: /DEL /PERSISTENT use Y: /DEL /PERSISTENT use x: "\\servername\surpacdata use y: "\\servername\department EndIf Then within the batch file i have this: kix32.exe logon.kix. And in GPO under user configuration/windows settings/scripts/logon i have addeded the batch file logon.bat. I DON'T KNOW WHAT IS HAPPENING TO THIS. |
||||||||
|
|
|||||||
SORRY I HAVE THE QUOTES ON LIKE THIS: use x: "\\servername\surpacdata" use y: "\\servername\department" |
||||||||
|
|
|||||||
In the GPO, under scripts you've got your kix-executable and your kix-scriptfile, in the user logon-scripts, you can then set kixexecutable.exe scriptfile.kix . afterwards this is set and replicated out, restart your machine you're testing it on. First off - make sure like you've done eariler (I think) that your script acctually works. copy it down to a workstation, with a user that's in one or some / all of the groups, run it and verify it. does it work there? Then it should work in your gpo. Mind tho that setting up via a GPO is a bit tricky - using the old way mentioned before -> in each users profile, set the logon.bat and in the netlogon-share place the files (logon.bat, kix-executable and script-file/files). If you are still go on via a GPO - verify that it acctually gets to the machine and user (gpresult on the machine with the user / wmi-query from the ad-mmc). Another easy way is to log each logon - make the script write to a file or why not the log. eitherway can be good to use during test-phase. |
||||||||
|
|
|||||||
Bjorn i am a little bit confuse with what you are saying. what you saying is to place both kix32.exe and the kix files under user configuration/windows settings/scripts/logon? |
||||||||
|
|
|||||||
when i run this script in command prompt on the test computer c:\kix>kix32 logon.kix /d it runs ok without any error messenge but it does not map the drive and the content of the logon.kix is IF INGROUP("ITDEPT") USE X: /DEL /PERSISTENT USE Y: /DEL /PERSISTENT USE X: "\\SERVER\SURPAC" USE Y: "\\SERVER\DEPARTMENT" ENDIF |
||||||||
|
|
|||||||
Now when i try the script below that NTDOC has to me to test, it is able to detect when a user is in the itdept group or not so it means is on the test computer but why it not working for the map drive and on the domain is what is killing me. If Not @LogonMode Break On Else Break Off EndIf Dim $SO $SO=SetOption('Explicit','On') $SO=SetOption('NoVarsInStrings','On') $SO=SetOption('NoMacrosInStrings','On') $SO=SetOption('WrapAtEOL','On') Dim $NoCache, $x $NoCache = DelKey('HKCU\Software\KiXtart\TokenCache') @KiX ? If InGroup(@Domain+'\itdept') 'Found in ITDEPT Group' ? Else 'Did not find in ITDEPT Group' ? EndIf 'Press any key to continue...' Get $x |
||||||||
|
|
|||||||
Well for now take an account and set it up in Active Directory Users and Computers Then modify the logon to be something like this. Using either KIX32.EXE or WKIX32.EXE and the name of your Script file. Since you're using only 2000/XP workstations then you don't need to use a batch file. Make sure the logon has the script information that I gave you. You should see it on screen and have to press a key to continue. Then once that is working you can look at modifying the script to actually do the drive mappings. |
||||||||
|
|
|||||||
NTDOC, NOW I AM ALMOST THERE. IT WORKS ON A LOCAL TEST COMPUTER ALRIGHT AND I ALSO WORKS WHEN I PLACE KIX32.EXE MAP.KIX IN A TEST USER PROFILE AS YOU INDICTED ABOVE. NOW I AM LEFT WITH HOW TO GET BATCH FILE TO WORK. I HAVE CREATED A BATCH FILE NETMAP.BAT AND PLACE THIS COMMAND "KIX32.EXE MAP.KIX" IN IT AND PLACE IT UNDER GROUP POLICY "UESR CONFIGURATION/WINDOWS SETTINGS/SCRIPTS/LOGON. THE REASON WHY I NEED THIS BATCH TO RUN IS THAT WE HAVE A LOT OF USERS IN OURS DOMAIN SO TO PUT THE "KIX32.EXE MAP.KIX" IN EVERY USER'S PROFILE IS ACTUALLY A BIG WORK FOR ME.I ACUTALLY HAVE A BATCH FILE IN THE LOGON WHICH WORKS ALRIGHT SO JUST WONDERING WHY THIS IS NOT. EDMUND |
||||||||
|
|
|||||||
My bad ekainyah. Didn't know that you could do like doc just posted, and you said you've done previously. And to answer your question, yes I belive that was what I meant. but, perhaps you should build your scripts a bit different so you can place 'kix32.exe kixfile.kix' there. then make the script decide and run the rest. |
||||||||
|
|
|||||||
OK BJORN. NOW I WANT TO BE ABLE TO USE THE BATCH FILE TO GET THIS WHOLE THING TO RUN. |
||||||||
|
|
|||||||
Please stop shouting in uppercase. |
||||||||
|
|
|||||||
hehee, Les made a funny! |
||||||||
|
|
|||||||
Hi ekainyah, I'd love to help but to be honest I've never setup accounts to run in that manner. Les may have or at least may know all the correct information as I'm not sure he does logon scripts himself but he is quite knowledgeable about it overall. I can provide you with a script though that will go through all your accounts and add the logon information automatically if you like. |
||||||||
|
|
|||||||
Quote: No, I did not. I am serious. SHOUTING is RUDE! |
||||||||
|
|
|||||||
ok |
||||||||
|
|
|||||||
NTDOC i will be very grateful if you can give that to me. once it will automatically add the script to the user profile i will be fine with that. |
||||||||
|
|
|||||||
Well Les actually provides code for that here on the last post but the rest of the thread may be a good read for you as well. Newbie Question (Write AD Object) http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB13&Number=156871 |