locked
fsmocheck test failed in active directory health script on Domain controller windows 2016 RRS feed

All replies

  • could you paste the code and error Please.
    Sunday, January 5, 2020 1:58 PM
  • Hi,

    Please see below are the codes.

     ####################FSMOCheck status##################
                   add-type -AssemblyName microsoft.visualbasic 
                   $cmp = "microsoft.visualbasic.strings" -as [type]
                   $sysvol = start-job -scriptblock {dcdiag /test:FSMOCheck /s:$($args[0])} -ArgumentList $DC
                   wait-job $sysvol -timeout $timeout
                   if($sysvol.state -like "Running")
                   {
                   Write-Host $DC `t FSMOCheck Test TimeOut -ForegroundColor Yellow
                   Add-Content $report "<td bgcolor= 'Yellow' align=center><B>FSMOCheckTimeout</B></td>"
                   stop-job $sysvol
                   }
                   else
                   {
                   $sysvol1 = Receive-job $sysvol
                   if($cmp::instr($sysvol1, "passed test FsmoCheck"))
                      {
                      Write-Host $DC `t FSMOCheck Test passed -ForegroundColor Green
                      Add-Content $report "<td bgcolor= 'Aquamarine' align=center><B>FSMOCheckPassed</B></td>"
                      }
                   else
                      {
                      Write-Host $DC `t FSMOCheck Test Failed -ForegroundColor Red
                      Add-Content $report "<td bgcolor= 'Red' align=center><B>FSMOCheckFail</B></td>"
                      }
                    }

    Error is sample 

    HasMoreData   : True
    StatusMessage : 
    Location      : localhost
    Command       : dcdiag /test:FSMOCheck /s:$($args[0])
    JobStateInfo  : Completed
    Finished      : System.Threading.ManualResetEvent
    InstanceId    : a926a011-99ab-47e8-bdf8-e6f91d3f5e1c
    Id            : 47
    Name          : Job47
    ChildJobs     : {Job48}
    PSBeginTime   : 1/6/2020 12:16:07 PM
    PSEndTime     : 1/6/2020 12:16:19 PM
    PSJobTypeName : BackgroundJob
    Output        : {}
    Error         : {}
    Progress      : {}
    Verbose       : {}
    Debug         : {}
    Warning       : {}
    Information   : {}
    State         : Completed

    TIDTCDCPRD01.amunet.ahlstrom-munksjo.com FSMOCheck Test Failed


    Thanks Devendra B2-Consulate(Capgemini)

    Monday, January 6, 2020 11:18 AM
  • So basically, the script itself has no error as it just means that it used dcdiag and it found out the FSMO test failed. To get more information, please run dcdiag /v and check on the output.

    This posting is provided AS IS with no warranties or guarantees , and confers no rights.

    Ahmed MALEK

    My Website Link

    My Linkedin Profile

    My MVP Profile

    Monday, January 6, 2020 12:04 PM
  • Through command prompt I can get details FSMO test result but not through script code and In script code mention "add-type -AssemblyName microsoft.visualbasic 
                   $cmp = "microsoft.visualbasic.strings" -as [type]
                   $sysvol = start-job -scriptblock {dcdiag /test:FSMOCheck /s:$($args[0])} -ArgumentList $DC"

    dcdiag /test:FSMOcheck

    Directory Server Diagnosis

    Performing initial setup:
       Trying to find home server...
       Home Server = **************
       * Identified AD Forest.
       Done gathering initial info.

    Doing initial required tests

       Testing server: ****-****\***********
          Starting test: Connectivity
             ......................... ************ passed test Connectivity

    Doing primary tests

       Testing server: ****-*******\***********


       Running partition tests on : ForestDnsZones

       Running partition tests on : DomainDnsZones

       Running partition tests on : Schema

       Running partition tests on : Configuration

       Running partition tests on : ********

       Running enterprise tests on : **********************
          Starting test: FsmoCheck
             ......................... ********************* passed test FsmoCheck


    Thanks Devendra B2-Consulate(Capgemini)

    Monday, January 6, 2020 12:11 PM
  • I see that the test is passed through the dcdiag so it should be the script having difficulties executing the command or interpreting the results. Have you tried running it using an elevated prompt? As well, please consider adding some logging so that you can get more details about what happens during the script execution. With that, you can know where the script is really getting stuck.

    This posting is provided AS IS with no warranties or guarantees , and confers no rights.

    Ahmed MALEK

    My Website Link

    My Linkedin Profile

    My MVP Profile

    Monday, January 6, 2020 12:18 PM
  • Hi,

    Yes I tired with elevated prompt but no luck.

    I am sorry I am from Active Directory, Could you please share me codes for adding logging.

    Thanks & Regards,

    Devendra Singh 


    Thanks Devendra B2-Consulate(Capgemini)

    Monday, January 6, 2020 1:40 PM