Active Directory - check if a computer name is already taken

Ishtar Terra 60 Reputation points
2023-07-12T09:41:06.2966667+00:00

When I configure a PC, one of the first steps is to assign a name to the device. I can only choose a name who belongs in "Active Directory Users and Computers". Before assigning a name, however, I need to figure out if that name is already taken by another device. To do this:

  • I open PowerShell and ping a name; if something reply to the ping, that means that the name is already taken;
  • I use a software named Advanced IP Scanner to examine the corporate's intranet to determine which names are already taken;
  • I use an asset management tool to see which names are already taken.

Despite these checks, sometimes I assign a name already taken.

I cannot simply delete a computer name and recreate it, because our Active Directory is managed my an external provider.

I need to figure out if there is a more reliable method to check which computer names are free to be assigned. Maybe a script on PowerShell, something like this I mean.

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,540 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-07-12T13:03:32.7+00:00

    You could so something like.

    Get-ADComputer -Filter 'Name -like "PC01*"'
    
    

    https://learn.microsoft.com/en-us/powershell/module/activedirectory/get-adcomputer?view=windowsserver2022-ps

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.