You are here

Active Directory computer names to lowercase

I find it annoying that some computer names in Active Directory appear in UPPERCASE.

You can fix this manually (here's an excellent post to show you how: https://www.bussink.ch/?p=1369) but if you manage a lot of systems you may want to use PowerShell.

To list your systems just use:

Get-ADComputer -Filter * -SearchBase "OU=Test,OU=Computers,DC=contoso,DC=com" | ft name,dnshostname,samaccountname

Adjust the SearchBase to your domain name and specify a smaller test OU to be safe.

To rename all systems in the OU use something like:

Get-ADComputer -Filter * -SearchBase "OU=Test,OU=Computers,DC=contoso,DC=com" | ForEach-Object {Set-ADComputer -Identity $_.samaccountname -dnshostname $_.dnshostname.ToLower()}

And/or:

Get-ADComputer -Filter * -SearchBase "OU=Test,OU=Computers,DC=contoso,DC=com" | ForEach-Object {Set-ADComputer -Identity $_.samaccountname -samaccountname $_.samaccountname.ToLower()}