Setcomputername

[DllImport("Kernel32.dll", CharSet = CharSet.Ansi, SetLastError = true)][return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetComputerName(string lpComputerName
);

Microsoft documentation: Link

Last updated