Jump to content


johnli

set AD computer description during deployment

Recommended Posts

Hi!

 

I'm using a VBS script during OS deployment to set the AD computer description.

But results are unpredictable at best (if you use numbers or gaps)

Does someone has a suggestion for a good working solution ?

 

script that I was testing :

 

cscript.exe adcompdesc.vbs “%ComputerDescription%”

dim Computerdn, strComputerName
dim Args


Set WshShell = WScript.CreateObject("WScript.Shell")
'----Get Computer DN------
Set objADSysInfo = CreateObject("ADSystemInfo")
ComputerDN = objADSysInfo.ComputerName
strcomputerdn = "LDAP://" & computerDN
Set objADSysInfo = Nothing
'-----Read commandline---
Set args = WScript.Arguments


strdesc = args(0)
Addcompdesc strdesc


Function addcompdesc(strPCdescription)


Set objComputer = GetObject (strComputerDN)
objComputer.Put "Description", strPCdescription  
objComputer.SetInfo
end function

 

Share this post


Link to post
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...