dsccommunity / dsccommunity/ActiveDirectoryDsc
ADUser, ADGroup: Specify samAccountName separately
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 388
- Forks
- 141
- PR merge metrics
- No merged PRs in 30d
Description
Details of the scenario you tried and the problem that is occurring
We have a need to set the samAccountName of a group created by an application installer which uses the group SID during installation, but which is named incompatibly with a different application. We can already set DisplayName and CommonName by specifying 'GroupName' key property as the full SID or by Distinguished Name, but there's no way to set the samAccountName which is what we actually need to set.
My use case is for ADGroup, but the same applies for ADUser and ADManagedServiceAccount.
Verbose logs showing the problem
Suggested solution to the issue
Add an optional property samAccountName (or possibly "NewGroupName") to allow setting the group name. This could alsö be useful for ADUser and ADManagedServiceAccount.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
# example using Hyper-V Administrators as it's SID is predictable
Invoke-DscResource -ModuleName ActiveDirectoryDsc -Name ADGroup -Method Get -Property @{GroupName
= 'S-1-5-32-578'}
The operating system the target node is running
OsName : Microsoft Windows Server 2019 Standard
OsOperatingSystemSKU : StandardServerEdition
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
PSVersion 5.1.17763.1852
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1852
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version of the DSC module that was used
ActiveDirectoryDsc 6.0.1
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 by locating the ADGroup, ADUser, and ADManagedServiceAccount resource implementations and inspect how GroupName accepts a SID or distinguished name. Verify how an optional samAccountName property would be handled for the requested resources, using the provided Invoke-DscResource example to confirm the resulting account name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100