SCPreferencesSetComputerName(_:_:_:)
Sets the computer name preference to the specified name.
Declaration
func SCPreferencesSetComputerName(_ prefs: SCPreferences, _ name: CFString?, _ nameEncoding: CFStringEncoding) -> BoolParameters
- prefs:
The preferences session.
- name:
The computer name.
- nameEncoding:
The encoding associated with the computer name.
Return Value
TRUE if successful; otherwise, FALSE.
Discussion
To commit these changes to permanent storage you must call the SCPreferencesCommitChanges(_:) function. In addition, you must call the SCPreferencesApplyChanges(_:) function for the new name to become active.