Most Popular Posts

Sunday, 4 November 2012

SCCM cross forest imaging

Whilst implementing SCCM for a customer who had 3 forests I was faced with the challenge of creating a single image that could be deployed to all 3 forests and still remain compliant from a licensing point of view.

So I came up with the following script:

Dim CorrectInput
Dim DomainName
Set Env = CreateObject("Microsoft.SMS.TSEnvironment")

Do While CorrectInput = False
Env("DomainName") = Inputbox("Enter the domain you wish to join the computer to Domain1, Domain2 & Domain3 are all valid inputs", "Prompt", , , 10)
If LCase(Env("DomainName")) = "domain1" Then
CorrectInput = True
ElseIf LCase(Env("DomainName")) = "domain2" Then
CorrectInput = True
ElseIf LCase(Env("DomainName")) = "domain3" Then
CorrectInput = True
End if
Loop

As you can see it prompts for input, converts to lower case, validates it and ultimately it stores the input in a task sequence variable called "DomainName" all I then have to do is duplicate the appropriate step in my task sequence and place an IF condition on it to run only when the Variable matches one of the 3 domains names, simple :)

Cheers
Wayne

No comments:

Post a Comment