dsccommunity / dsccommunity/ComputerManagementDsc
Computer names longer than 15 are blocked, but the limit is 63
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 338
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
Details of the scenario you tried and the problem that is occurring
Renaming a PC with a name that is more than 15 characters will fail. However if you rename the same PC through right-click Start, System, "Rename this PC" you can use up to 63 characters (I understand the 15 character limit comes from NetBIOS).
Verbose logs showing the problem
PowerShell DSC resource DSC_Computer failed to execute Test-TargetResource functionality with error message: Cannot validate argument on parameter 'Name'. The character length of the 16 argument is too long. Shorten the character length of the argument so it is fewer
than or equal to "15" characters, and then try the command again.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
Suggested solution to the issue
To avoid breaking existing behaviour, add a new property that supports the 63 character limit.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Computer RenamePC
{
Name = "1234567890123456"
}
The operating system the target node is running
OsName : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture : 64-bit
WindowsVersion : 1809
WindowsBuildLabEx : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage : en-US
OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
Name Value
PSVersion 5.1.17763.2183
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.2183
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version of the DSC module that was used ('dev' if using current dev branch)
Latest as installed by PS (8.5.0)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DSC_Computer resource and reproduce the RenamePC configuration using a name longer than 15 characters. Review how the existing Name property validates and applies computer names; done means a separate property supports names up to 63 characters without changing existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100