Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

DS 6.9 Condition to DS 7.1 IP Check

Created: 28 Jun 2013 • Updated: 05 Aug 2013 | 8 comments
This issue has been solved. See solution.

I am recreating a DS 6.9 job into DS 7.1 which contains conditions.  This particular job contains conditions that checks to see what IP range as system is on then deploys a task which joins the computer to a specific domain depening on the IP that the system has. I have looked through the docs and didnt find much on how to work with conditions.

Do I need to create a vbscript first to find the IP and then create a conditons that points to the vsscript?

Operating Systems:

Comments 8 CommentsJump to latest comment

Thomas Baird's picture

Probably.

In theory you could do this with filters, but that'd be nasty compared to a simple VBS.

Were it me, I'd make a single VBS that does both.  First, find the IP and put it (or a modified version of it) into a variable.  Then use a VBS Case statement to assign it to a domain.  One-script-does-all.

IMO

 

GL!  The condition in 6.9 must have been really interesting to build!

Thomas Baird
Enthusiast for making things better!

 

no-idea's picture

Create a RunScript type Command Shell

Add something like "ipconfig" or "echo %IPADRESS% (there should be a System Token for that) and save script output ot task.

Add this task to your "Domain Join" job.

Next step create a condition "IF 'RunScript' CONTAINS '192.168.0.". This should be your desired IP range.

Now add your system configuration task into IF-ELSE loop.

Voila.

 

 

rcostanzo's picture

I created a new script with the steps below and get an error of "Evaluated False" when the condition ran.

1. A new script was created and I added the script type of Command Script and added "echo %AGENTIPADDR%"

2. I selected the "Advanced" radio button and put a checkmark in the "Save script output with task staus"

3. I tested the script first and got the Output Properties shown below which is correct the correct IP.

 Script: C:\Windows\system32>echo 172.31.121.41
172.31.121.41

4. I created a job and added in the scrpt with a conditon as shown below.

7-12-2013 10-08-32 AM.png

5. Here is the error I got.

7-12-2013 10-29-42 AM.png

 

no-idea's picture

Hmmm, and what did the status say? If you click "Completed" you should see the IP returned...

Maybe your client got a different IP. In this case you should just check for "172.31.121".

 

no-idea's picture

One more thing, have taken another look onto your picture...

The moment you select your script from drop-down list while creating the condition, what do you choose?

- SCRIPT - Return Value > will return the exit code

- SCRIPT - Success > successful or not

- SCRIPT - Script > output in task status

- SCRIPT - Script Errors > probably if script runs into an error

In your case you have to choose the third option "Script"!

 

rcostanzo's picture

The script was set to Return Value so I changed it to Output and set the ip to 172.31.121. 

I ran the job again and got an error shown below.

7-15-2013 7-58-56 AM.png

no-idea's picture

You created the condition before you added the task.

Remove condition and rebuild it.

 

SOLUTION
rcostanzo's picture

no-idea,  I removed the condition and then created a new one.  When I created the new condition I changed the script to  Script > output in task status as you suggested and that resolved the issue.  Thank you for the help on this.