Skip to content

set AD computer description during deployment

Featured Replies

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

 

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.