Want SYSVOL state post FRS>DFSR migration

Welcome Forums General PowerShell Q&A Want SYSVOL state post FRS>DFSR migration

This topic contains 2 replies, has 2 voices, and was last updated by

4 months, 2 weeks ago.

  • Author
  • #121368

    Points: 71
    Rank: Member


    I have cobbled this script to try and get the current Net Share of SYSVOl after my dfsr migration. I just want a (Powershell) alternative to dfsrmig /getglobalstate as some of our DCs are behind firewalls and PS is able to go where Windows APIs are not allowed.

    $DCs = Get-ADDomainController -Server corp.com -Filter * | sort hostname |
        select -Property hostname -ExpandProperty hostname
    $dc = New-PSSession -ComputerName $DCs -Credential Get-Credential
    Invoke-Command -Session $dc {
        net share }

    This works but I can't see the hostname, as expected. After running GM after my Invoke-Command, I see PSComputerName as a property, but then when I tried:

    Invoke-Command -Session $dc {net share} | select "Share name", Resource, PSComputerName

    I had empty results.

    I thought I would even try to get fancy but failed miserably:

    Invoke-Command -Session $dc {
        net share | ?{$_."Share Name" -Like "*SYSVOL*"}

    Can you help me massage this to show the SYSVOL path and the hostname?


  • #121399

    Points: 1,620
    Helping Hand
    Rank: Community Hero

    net is a native executable and outputs text not objects, hence you can't do Select 'Share Name'.
    You could use CIM here.

    Get-CimInstance -ClassName win32_share -ComputerName $Server -Filter "Name like '%Sys%'"
    • #121413

      Points: 71
      Rank: Member

      Thank you kvprasoon

The topic ‘Want SYSVOL state post FRS>DFSR migration’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort