Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DFSNamespaceRoot: The requested object was not found when adding another Namespaceserver #119

Open
LoSaMe opened this issue Aug 25, 2021 · 0 comments
Labels
needs investigation The issue needs to be investigated by the maintainers or/and the community.

Comments

@LoSaMe
Copy link

LoSaMe commented Aug 25, 2021

Details of the scenario you tried and the problem that is occurring

We deploy in our configuration a hole Domain with 2 DCs. The DFSNamespaceRoot on the Primary DC is set up successfully.
After the domain is deployed and the second DC-Server is joined as DC I try to repeat the same DFSNamespaceRoot with a adjusted TargetPath to add the 2. DC to the namespace (TargetNode is the 2. DC). After that, the second DC is added but an error message appears and the configuratin fails: the object was not found. My research leads me to the command Get-DfsnRootTarget in the function (my assumption of the cause could be wrong).
I entered the command Get-DfsnRootTarget on the second DC and the error message was the same. Of course the TargetPath dont exist at the moment I try to add the Server (as already mentioned the Server is added after that).

    try
    {
        $dfsnTarget = Get-DfsnRootTarget `
            -Path $Path `
            -TargetPath $TargetPath `
            -ErrorAction Stop
    }
    catch [Microsoft.Management.Infrastructure.CimException]
    {
        $dfsnTarget = $null
    }
    catch
    {
        throw $_
    }
    return $dfsnTarget

The needed command would be New-DfsnRootTarget which comes after the error.

 # Get target
            $target = Get-RootTarget `
                -Path $Path `
                -TargetPath $TargetPath

            # Does the target need to be updated?
            [System.Boolean] $targetChange = $false

            # The Target properties that will be updated
            $targetProperties = @{}

            # Check the target properties
            if (($ReferralPriorityClass) `
                -and ($target.ReferralPriorityClass -ne $ReferralPriorityClass))
            {
                $targetProperties += @{
                    ReferralPriorityClass = ($ReferralPriorityClass -replace '-','')
                }
                $targetChange = $true
            } # if

            if (($ReferralPriorityRank) `
                -and ($target.ReferralPriorityRank -ne $ReferralPriorityRank))
            {
                $targetProperties += @{
                    ReferralPriorityRank = $ReferralPriorityRank
                }
                $targetChange = $true
            } # if

            # Is the target a member of the namespace?
            if ($target)
            {
                # Does the target need to be changed?
                if ($targetChange)
                {
                    # Update target settings
                    $null = Set-DfsnRootTarget `
                        -Path $Path `
                        -TargetPath $TargetPath `
                        @TargetProperties `
                        -ErrorAction Stop
                }
            }
            else
            {
                # Add target to Namespace
                $null = New-DfsnRootTarget `
                    -Path $Path `
                    -TargetPath $TargetPath `
                    @TargetProperties `
                    -ErrorAction Stop
            } # if

Maybe I just got the wrong approach to add another namespace server but I couldn't find another way.

Verbose logs showing the problem

Error not in English but the essence is that the the requested object was not found.

Suggested solution to the issue

The DSC configuration that is used to reproduce the issue (as detailed as possible)

# Primary DFS snippet
Node $AllNodes.Where{ $_.Rolle -eq "PrimaryDomainController" }.NodeName {
# Namespaceroot erstellen
        DFSNamespaceRoot "$($Node.NodeName)`-DFSNamespaceRootPrimary-$FQDN" {
            Path       = "\\$FQDN\DFS"
            TargetPath = "\\$($Node.NodeName)\DFS"
            Ensure     = 'Present'
            Type       = 'DomainV2'
            DependsOn  = @("[SmbShare]$($Node.NodeName)-SmbShare-DFS")
        }
}

# Secondary DFS snippet
Node $AllNodes.Where{ $_.Rolle -eq "DomainController" }.NodeName {
 Namespaceroot erstellen
        DFSNamespaceRoot "$($Node.NodeName)`-DFSNamespaceRootPrimary-$FQDN" {
            Path       = "\\$FQDN\DFS"
            TargetPath = "\\$($Node.NodeName)\DFS"
            Ensure     = 'Present'
            Type       = 'DomainV2'
            DependsOn  = @("[SmbShare]$($Node.NodeName)-SmbShare-DFS")
            PsDscRunAsCredential = ($CredList | Where-Object { $_.UserName -like "*\Administrator" })
        }
}

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 : de-DE
OsMuiLanguages : {de-DE}

Version and build of PowerShell the target node is running

PSVersion 5.1.17763.1007
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1007
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)

4.3.0.0

@PlagueHO PlagueHO added the needs investigation The issue needs to be investigated by the maintainers or/and the community. label Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation The issue needs to be investigated by the maintainers or/and the community.
Projects
None yet
Development

No branches or pull requests

2 participants