Forum Discussion
Jaime_IT
Dec 21, 2023Brass Contributor
Device Bulk Rename Struggle
We've struggled with this for quite some time now. What we need to do is, discover all Intune devices with one of the following elements true: 10.1.x.x IP address 10.111.x.x IP address Then re...
Jaime_IT
Jan 05, 2024Brass Contributor
So the issue I run into with this suggestion is that Intune does not natively support device renaming based on specific criteria like IPv4 addresses. I've checked Intune 3x, and unless I'm missing something here or you have another suggestion, I'm back to working on a script. Though I think that I can create a more basic script and deploy it to all devices. Something like this:
$ipAddress = (Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.IPAddress -like '10.1.*' }).IPAddress
if ($ipAddress -ne $null) {
$serialNumber = (Get-WmiObject Win32_BIOS).SerialNumber
$newComputerName = "A-$serialNumber"
Rename-Computer -NewName $newComputerName -Force -Restart
} else {
Write-Host "IPv4 address does not match the criteria. No action taken."
}
Thoughts?
$ipAddress = (Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.IPAddress -like '10.1.*' }).IPAddress
if ($ipAddress -ne $null) {
$serialNumber = (Get-WmiObject Win32_BIOS).SerialNumber
$newComputerName = "A-$serialNumber"
Rename-Computer -NewName $newComputerName -Force -Restart
} else {
Write-Host "IPv4 address does not match the criteria. No action taken."
}
Thoughts?
Jan 23, 2024
Any update?
- Jaime_ITMar 04, 2024Brass Contributor
Still a struggle, nothing has really worked. We got a script from a Microsoft engineer, it renamed less than 100 devices, and he's not sure why yet. Pretty lost here and continuing one by one as time permits.
- Mar 04, 2024But are you using a script on the client side which renames the computername or are you trying do to it with Graph?
- Jaime_ITMar 04, 2024Brass ContributorWe've attempted both methods with zero success. The script from the MS Engineer ran on Intune gave us monitoring, which broke-out the different subnets and allowed for export of the CSVs. That gave us good references as to what we have in whatever subnet, but as stated previously, it renamed approximately 100 devices out of thousands.