Post by Christofarian on Jun 19, 2018 12:22:51 GMT
Is there anyway to get the computer description set in AD . .I have everything set to pass a variable to OSDComputerDescription, and that does get set as the local Computer Description, but I cant seem to get it into AD.
How I do it,
Step 1
xml for getting user entered computer description ( i Passed the output to so many variables becuase I couldnt figure out which one my "Computer description" VBS scripts that set the variable to the actual computer were suing
<ChoiceInput Variable="Department" Question="Please select Department" Required="True" >
<Choice Option="Administration" Value=" - A"/>
<Choice Option="Accounting" Value=" - AC"/>
<Choice Option="Architecture" Value=" - AR"/>
<Choice Option="Project Controls" Value=" - BSC" />
<Choice Option="Civil" Value=" - C" />
<Choice Option="Civil Survey" Value=" - CS" />
<Choice Option="Environmental" Value=" - E" />
<Choice Option="Geotechnical" Value=" - G" />
<Choice Option="GIS" Value=" - GIS" />
<Choice Option="IT" Value=" - IT" />
<Choice Option="Mechanical,Electrical,Pumbing" Value=" - MEP" />
<Choice Option="Structural" Value=" - S" />
<Choice Option="Utility Services" Value=" - US" />
<Choice Option="Water Resources/Waste Water" Value=" - WR" />
<Choice Option="Energy Services" Value=" - ES" />
</ChoiceInput>
</Action>
<Action Type="TSVar" Name="ComputerDescription">"%Name%%Department%%Office%"</Action>
<Action Type="TSVar" Name="OSDComputerDescription">"%Name%%Department%%Office%"</Action>
<Action Type="TSVar" Name="Description">"%Name%%Department%%Office%"</Action>
<Action Type="Info" Title="Computer Information" Name="Computer Description" ShowBack="True">
<![CDATA[The name of this system will be <b>%OSDComputerName%</b>
The Description of this computer will be <b>%ComputerDescription%</b>.]]>
</Action>
Then I created 2 task sequences when the computer was doing its final steps right before MDT installs applications, that assigns the variable that was set previously to the local and AD computer desctiption, and like I mentiopned i cannot get the AD one to work
they are as follows
Local
<job id="ZTISetComputerDescriptionLocally">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">
'//////////////////////////////////////////////////
'//
'// Script File:
'//
'// ZTISetComputerDescriptionLocally.wsf
'//
'// This script sets the computer description value
'// locally on the computer (system properties)
'//
'// Author: Johan Arwidmark
'// URL: www.deployvista.com
'//
'// Disclaimer
'// This script is provided "AS IS" without express
'// or implied warranty of any kind
'//
'//////////////////////////////////////////////////
Dim sReturn
Dim sCmd
If oEnvironment.Item("ComputerDescription") = "" Then
oLogging.CreateEntry "No Computer Description set...", LogTypeWarning
Else
oLogging.CreateEntry "Computer Description variable set to: " & oEnvironment.Item("ComputerDescription"), LogTypeInfo
' Create the cmd to set computer description
sCmd="cmd /c net config server /srvcomment:""" & oEnvironment.Item("ComputerDescription") & """ "
' Log the cmd we are going to run
oLogging.CreateEntry "About to run " & sCmd,LogTypeInfo
' Set the Computer Description
sReturn=oShell.run (sCmd,1,False)
' Log the return code from starting net command
oLogging.CreateEntry "Return code from " & sCmd & " was : " & sReturn,LogTypeInfo
End If
</script>
</job>
and the active directory one
<job id="ZTISetComputerDescriptionLocally">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">
'//////////////////////////////////////////////////
'//
'// Script File:
'//
'// ZTISetComputerDescriptionLocally.wsf
'//
'// This script sets the computer description value
'// locally on the computer (system properties)
'//
'// Author: Johan Arwidmark
'// URL: www.deployvista.com
'//
'// Disclaimer
'// This script is provided "AS IS" without express
'// or implied warranty of any kind
'//
'//////////////////////////////////////////////////
Dim sReturn
Dim sCmd
If oEnvironment.Item("ComputerDescription") = "" Then
oLogging.CreateEntry "No Computer Description set...", LogTypeWarning
Else
oLogging.CreateEntry "Computer Description variable set to: " & oEnvironment.Item("ComputerDescription"), LogTypeInfo
' Create the cmd to set computer description
sCmd="cmd /c net config server /srvcomment:""" & oEnvironment.Item("ComputerDescription") & """ "
' Log the cmd we are going to run
oLogging.CreateEntry "About to run " & sCmd,LogTypeInfo
' Set the Computer Description
sReturn=oShell.run (sCmd,1,False)
' Log the return code from starting net command
oLogging.CreateEntry "Return code from " & sCmd & " was : " & sReturn,LogTypeInfo
End If
</script>
</job>
any help would be greatly apreciated
How I do it,
Step 1
xml for getting user entered computer description ( i Passed the output to so many variables becuase I couldnt figure out which one my "Computer description" VBS scripts that set the variable to the actual computer were suing
<ChoiceInput Variable="Department" Question="Please select Department" Required="True" >
<Choice Option="Administration" Value=" - A"/>
<Choice Option="Accounting" Value=" - AC"/>
<Choice Option="Architecture" Value=" - AR"/>
<Choice Option="Project Controls" Value=" - BSC" />
<Choice Option="Civil" Value=" - C" />
<Choice Option="Civil Survey" Value=" - CS" />
<Choice Option="Environmental" Value=" - E" />
<Choice Option="Geotechnical" Value=" - G" />
<Choice Option="GIS" Value=" - GIS" />
<Choice Option="IT" Value=" - IT" />
<Choice Option="Mechanical,Electrical,Pumbing" Value=" - MEP" />
<Choice Option="Structural" Value=" - S" />
<Choice Option="Utility Services" Value=" - US" />
<Choice Option="Water Resources/Waste Water" Value=" - WR" />
<Choice Option="Energy Services" Value=" - ES" />
</ChoiceInput>
</Action>
<Action Type="TSVar" Name="ComputerDescription">"%Name%%Department%%Office%"</Action>
<Action Type="TSVar" Name="OSDComputerDescription">"%Name%%Department%%Office%"</Action>
<Action Type="TSVar" Name="Description">"%Name%%Department%%Office%"</Action>
<Action Type="Info" Title="Computer Information" Name="Computer Description" ShowBack="True">
<![CDATA[The name of this system will be <b>%OSDComputerName%</b>
The Description of this computer will be <b>%ComputerDescription%</b>.]]>
</Action>
Then I created 2 task sequences when the computer was doing its final steps right before MDT installs applications, that assigns the variable that was set previously to the local and AD computer desctiption, and like I mentiopned i cannot get the AD one to work
they are as follows
Local
<job id="ZTISetComputerDescriptionLocally">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">
'//////////////////////////////////////////////////
'//
'// Script File:
'//
'// ZTISetComputerDescriptionLocally.wsf
'//
'// This script sets the computer description value
'// locally on the computer (system properties)
'//
'// Author: Johan Arwidmark
'// URL: www.deployvista.com
'//
'// Disclaimer
'// This script is provided "AS IS" without express
'// or implied warranty of any kind
'//
'//////////////////////////////////////////////////
Dim sReturn
Dim sCmd
If oEnvironment.Item("ComputerDescription") = "" Then
oLogging.CreateEntry "No Computer Description set...", LogTypeWarning
Else
oLogging.CreateEntry "Computer Description variable set to: " & oEnvironment.Item("ComputerDescription"), LogTypeInfo
' Create the cmd to set computer description
sCmd="cmd /c net config server /srvcomment:""" & oEnvironment.Item("ComputerDescription") & """ "
' Log the cmd we are going to run
oLogging.CreateEntry "About to run " & sCmd,LogTypeInfo
' Set the Computer Description
sReturn=oShell.run (sCmd,1,False)
' Log the return code from starting net command
oLogging.CreateEntry "Return code from " & sCmd & " was : " & sReturn,LogTypeInfo
End If
</script>
</job>
and the active directory one
<job id="ZTISetComputerDescriptionLocally">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">
'//////////////////////////////////////////////////
'//
'// Script File:
'//
'// ZTISetComputerDescriptionLocally.wsf
'//
'// This script sets the computer description value
'// locally on the computer (system properties)
'//
'// Author: Johan Arwidmark
'// URL: www.deployvista.com
'//
'// Disclaimer
'// This script is provided "AS IS" without express
'// or implied warranty of any kind
'//
'//////////////////////////////////////////////////
Dim sReturn
Dim sCmd
If oEnvironment.Item("ComputerDescription") = "" Then
oLogging.CreateEntry "No Computer Description set...", LogTypeWarning
Else
oLogging.CreateEntry "Computer Description variable set to: " & oEnvironment.Item("ComputerDescription"), LogTypeInfo
' Create the cmd to set computer description
sCmd="cmd /c net config server /srvcomment:""" & oEnvironment.Item("ComputerDescription") & """ "
' Log the cmd we are going to run
oLogging.CreateEntry "About to run " & sCmd,LogTypeInfo
' Set the Computer Description
sReturn=oShell.run (sCmd,1,False)
' Log the return code from starting net command
oLogging.CreateEntry "Return code from " & sCmd & " was : " & sReturn,LogTypeInfo
End If
</script>
</job>
any help would be greatly apreciated