Jump to content


  • 0
bu7ch

Get computer name length

Question

1 answer to this question

Recommended Posts

  • 0
<br />I recently realized that some of our computers have long names (>15 characters). Is there a way to determine or query how many computers have a name that is greater than 14 characters?<br />

 

 

probably u can try the below query to get the results:you can also modify script to pipe the results into excel.

 

Set objSysInfo = CreateObject("ADSystemInfo")

strComputerDN = objSysInfo.ComputerName

Set objComputer = GetObject("LDAP://" & strComputerDN)

strFullDNSName = objComputer.dnsHostName

strHostNameOnly = left(strFullDNSName, instr(strFullDNSName, ".") - 1)

Wscript.Echo strHostNameOnly

 

BTW,Did u enable longer names in the computer account of the Active Directory domain. by default if the computer name is more than 15 characters ,it will take only first 15 characrts and join the computer to domain AFAIK.

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
Answer this question...

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.