mtniehaus / renamecomputer Goto Github PK
View Code? Open in Web Editor NEWRename a Hybrid AADJ computer after an Autopilot deployment
License: MIT License
Rename a Hybrid AADJ computer after an Autopilot deployment
License: MIT License
Hi @mtniehaus ,
I get an error message when i try to run the script.
I have created a separated OU and placed the computer objects there to be renamed.
Regards,
Moses
This is a genuinely nice script. :)
May I request you to amend one more check along with AD connectivity & domain join status check, script should check the computer name as well. If a computer's name matches, then only rename the computer.
If computer name starts with "XYZ-*" then only rename the computer.
Just a loud thought if I deploy this script to all existing devices (converting devices to autopilot) should not rename these devices. So, to avoid this requesting change.
Many thanks.
Couldn't the .ps1 just be run as a remediation? Give or take a bit of detection tweaking -- I mean, the logic is already in there really... Or am I missing something?
I suspect the creation of this solution pre-dates remediation...??
...Or, is it an App so that it can run during OOBE? (and therefore if I'm happy to run post OOBE, I can proceed as a script/remediation, with the relevant parts of the .ps1...)
We have a strict requirement to name our computers a certain format and none of this is derived from data available on the machine (its not serial based where we can just look inside the BIOS using WMIC).
Is there a way to prompt for a computer name and use that?
Get-ComputerInfo actually returns with a typo for BiosSerialNumber. It returns BiosSeralNumber. So the serialnumber cant be fetched if Get-CimInstance doesnt have a assettag. So either edit the script to fetch serial number from ciminstance bioselement or add the typo into get-computerinfo.
Is it possible to keep the scheduled task even the object is in Active Directory present? So, i can delete the old AD object manually and the script can run again.
I changed the rename portion of the script to suit my needs and ran into an issue where the script would spin indefinitely on 'Installing' .. turns out some of my computer names exceeded the 15 char netbios limit and was throwing up a confirmation box.
To address this, add -Force to the end of the Rename-Computer command:
Rename-Computer -NewName $newName -Force
The following commands don't add the -randomdelay value to the trigger.
$triggers += New-ScheduledTaskTrigger -AtLogOn -RandomDelay $timespan
$triggers += New-ScheduledTaskTrigger -AtStartup -RandomDelay $timespan
Should be:
$triggers += New-JobTrigger -AtLogOn -RandomDelay $timespan
$triggers += New-JobTrigger -AtStartup -RandomDelay $timespan
Not an issue per say, but some confusion. How did you create the Intune file? I had to adjust a few things as the name was coming back null. But when I create the Intune file, its like 6gb and won't import.
Simple fix, but the actual property tag for the BIOS Serial Number in Get-ComputerInfo is actually BiosSeralNumber, at least on Windows 11.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.