We use Configuration managar to install operating systems, that for some genius reason does not have a simple way to set rules for machine names.
So im looking for a C# API that allows me to change the computer name ( NETBIOS) and change it in Active directory at the same time. I want to set the name AFTER im connected to AD so i can check if the machine had a old name and belonged to a none spesfic OU.
I have tried:
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
static extern bool SetComputerNameEx(COMPUTER_NAME_FORMAT NameType,string lpBuffer);
This one does change the local machine name, but this will corrupt the AD connection.