Description
Problem description
There are two forests with a single domain each, Computer1 is in domainA and user1 is in domainB. There is a full trust relationship between domains, it should be noted that NETBIOS name is not the same as FQDN on either forest.
I am attempting to add User1 to the local administrators group on Computer1. It should be noted that a number of additional users from domainA are already added into the Computer1 administrative user group via Group Policy.
The issue can be replicated when using Credential property and PsDscRunAsCredential.
The credential used for the resource is for a user which is present in DomainB and has local admin on the computer in domain A.
Same issue was reported in PSDesiredStateConfiguration repository and also the fix with PR was provided.
Issue -> PowerShell/PSDscResources#82
PR for FIX -> PowerShell/PSDscResources#198
Verbose logs
[[xGroup]Resource0::[xGroupSet]***_2-IIS_IUSRS] in 11.1030 seconds.
PowerShell DSC resource DSC_xGroupResource failed to execute Set-TargetResource functionality
At line:1 char:1
+ & 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' -NoLogo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (PowerShell DSC ... functionality :String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
with error message: Exception calling "Add" with "1" argument(s): "The network path was not found.
DSC configuration
xGroup AddUser
{
GroupName = "Administrators"
MembersToInclude = @("DOMAINB\USER1")
Credential = $DomainBCredential
Ensure = 'Present'
}
Suggested solution
This fix was tested also on our environment and worked PowerShell/PSDscResources#198
Operating system the target node is running
OsName : Microsoft Windows Server 2016 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.5356.amd64fre.rs1_release.220906-1211
OsLanguage : en-US
OsMuiLanguages : {en-US}
PowerShell version and build the target node is running
Name Value
---- -----
PSVersion 5.1.14393.5127
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.5127
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
xPSDesiredStateConfiguration version
xPSDesiredStateConfiguration 9.1.0