|
| Guests can view and read messages in the community forums, but you must register and log in to Deployment Forum before you can post messages. Click Register at the top of this page. Before posting messages, please read the forum guidelines at the bottom of this page. | |
| | Author | Messages | |
FarmerPete
Posts:168

 | | 09/09/2008 12:47 PM |
| | I am trying to create a user exit script. I am trying to make a single task sequence for every image. I am doing that by taking a task sequence and having 5 install OS tasks. Each is set with if logic to only allow the image to work on the specific make or model that it works for. My problem is, I have a few Spanish images that blows everything up. This leaves me with either creating two task sequences, an English and a Spanish, or I can try to come up with a way to distinguish the two before the OS is installed. The simplest approach I can think of is to use the computer name. We manually enter the computer name into the task sequence for every deployment. So if the system name was TIJ#### (for Tijuana), my exit script could return Tij to a property. I could then take that property and use it to kick off the logic of the language. My only problem is, how do you get a user exit script to run after I enter the computer name into the deployment wizard? CS.ini Computername = #TrunkComputerName# UserExit = userexit.vbs userexit.vbs Function UserExit(sType, sWhen, sDetail, bSkip) UserExit = Success End FunctionFunction TrunkComputerName() TrunkComputerName = Left(oEnvironment.Item("ComputerName"),3) oLogging.CreateEntry "USEREXIT - Computer Name has been set to " & TrunkComputerName, LogTypeInfo End Function | | | |
| Konrad
Posts:67

 | | 09/09/2008 6:22 PM |
| Could you do it this way instead:
Before your first Install OS task, add a custom script that does something like: Set oEnvironment = CreateObject("Microsoft.SMS.TSEnvironment") oEnvironment("TruncatedComputerName") = Left(oEnvironment("COMPUTERDESCRIPTION"), 3)
And then use this new Task Sequence variable within your Task Sequence to do an "If" against the variable to see if it is set to "TIJ", and if it is then do one of your Spanish images, otherwise proceed to your other images? | | | |
| FarmerPete
Posts:168

 | | 09/10/2008 2:45 PM |
| I tried doing something similar to that using a custom vbscript using Ben Hunter's example on his old blog. The script runs fine if I run it manually from the PE environment, but the task sequence blows up if I run it as part of the task sequence. I tried running your script, and I had no luck. I'm not sure if I'm doing something wrong. I have a lot of experience with MDT and a decent amount of experience with VBScript, but I don't have much experience combining the two.
| | | |
|
| | You are not authorized to post a reply. |
|
| |
ActiveForums 3.7 | |
|  | These forums are a user-supported community for IT professionals to exchange deployment tips, solutions, and techniques. For the benefit of all Deployment Forum members, please observe the following guidelines when posting to these forums: - We reserve the right to remove any message. Our moderators will remove all messages that are not respectful or productive. Profanity, racism, prejudice, and flaming are not tolerated.
- Do not advertise products or services. Our moderators will remove all advertisements or service announcements. Product and service recommendations from active Deployment Forum members are encouraged, however.
- Make sure your question isn't already answered. Before posting questions, search the forums. After ensuring that your questions are unique, post them to the most appropriate forum. This will help reduce noise in the forums.
- Help make the most of each thread. Do not post unrelated messages to a thread. Also, if you've resolved a question outside of these forums, please share the solution with other members by posting it back to the thread.
- Do not share confidential information. Confidential information includes product keys and addresses. Our moderators will edit any message containing confidential information, so double-check messages and their attachments before posting them.
- Post messages using only the English language. For the benefit of all Deployment Forum members, please post your messages using the English language.
We hope that you enjoy using this community. Please submit your comments and feedback on the Comments and Feedback page or post them to the Comments, Feedback forum. |
|  |
| |
|