Windows Vista Forums

retrieve all workgroup computers list
  1. #1


    Join Date : May 2008
    Posts : 88
    Vista Home Premium 32bit
    Local Time: 08:54 AM
    italy

    retrieve all workgroup computers list

    I'm still here with another question of mine.
    Is it possible to retrieve the list of all computers within my workgroup?


      My System SpecsSystem Spec

  2. #2


    Shay Levy [MVP] Guest

    Re: retrieve all workgroup computers list

    Hello sardinian_guy,

    I didn't test it... replace "WORKGROUP" with your workgroup name

    [ADSI]"WinNT://WORKGROUP" | % {$_.psbase.children }


    ---
    Shay Levy
    Windows PowerShell MVP
    http://blogs.microsoft.co.il/blogs/ScriptFanatic
    PowerShell Toolbar: http://tinyurl.com/PSToolbar


    s> I'm still here with another question of mine.
    s> Is it possible to retrieve the list of all computers within my
    s> workgroup?



      My System SpecsSystem Spec

  3. #3


    Join Date : May 2008
    Posts : 88
    Vista Home Premium 32bit
    Local Time: 08:54 AM
    italy

      Thread Starter

    Re: retrieve all workgroup computers list

    Hi Shay. Thanks for your answer.
    Unluckily it doesn't work. It returns me this error

    Eccezione durante il recupero del membro "ClassId2e4f51ef21dd47e99d3c952918aff9cd": "Non implementato


    Since yesterday I'm looking for a solution.
    I've found this article
    Hey, Scripting Guy! How Can I Use Windows PowerShell to Get a List of All My Computers?

    but it concerns with domain

    and even this thread
    Powershell Listing "Microsoft Windows Networking" of Domains and Workgroups ?


    where your code

    [ADSI]"WinNT:"|% {$_.psbase.children } |% {$_.psbase.path.substring(8)}

    returns the right workgroup name but I'm not able to list my pcs.

    edit. If I just write

    [ADSI]"WinNT://myworkgroup"

    powershell doesn't return any error but a column "distinguishedname" without any value.

      My System SpecsSystem Spec

  4. #4


    Vadims Podans Guest

    Re: retrieve all workgroup computers list

    It relies on Computer Browser mechanism?

    --
    WBR, Vadims Podans
    PowerShell blog - www.sysadmins.lv

    "Shay Levy [MVP]" <no@xxxxxx> rakstīja ziņojumā
    "news:89228ed26408e8cb4a125dca5c17@xxxxxx"...

    > Hello sardinian_guy,
    >
    > I didn't test it... replace "WORKGROUP" with your workgroup name
    >
    > [ADSI]"WinNT://WORKGROUP" | % {$_.psbase.children }
    >
    >
    > ---
    > Shay Levy
    > Windows PowerShell MVP
    > http://blogs.microsoft.co.il/blogs/ScriptFanatic
    > PowerShell Toolbar: http://tinyurl.com/PSToolbar
    >
    >
    > s> I'm still here with another question of mine.
    > s> Is it possible to retrieve the list of all computers within my
    > s> workgroup?
    >
    >

      My System SpecsSystem Spec

  5. #5


    Lognoul Marc [MVP] Guest

    Re: retrieve all workgroup computers list

    It does.

    --
    Marc [MCSE, MCTS, MVP]
    [Heureux celui qui a pu pénétrer les causes secrètes des choses]
    [Blog: http://www.marc-antho-etc.net/blog/]

    "Vadims Podans" <vpodans> wrote in message
    news:#c22M9#eJHA.5188@xxxxxx

    > It relies on Computer Browser mechanism?
    >
    > --
    > WBR, Vadims Podans
    > PowerShell blog - www.sysadmins.lv
    >
    > "Shay Levy [MVP]" <no@xxxxxx> rakstīja ziņojumā
    > "news:89228ed26408e8cb4a125dca5c17@xxxxxx"...

    >> Hello sardinian_guy,
    >>
    >> I didn't test it... replace "WORKGROUP" with your workgroup name
    >>
    >> [ADSI]"WinNT://WORKGROUP" | % {$_.psbase.children }
    >>
    >>
    >> ---
    >> Shay Levy
    >> Windows PowerShell MVP
    >> http://blogs.microsoft.co.il/blogs/ScriptFanatic
    >> PowerShell Toolbar: http://tinyurl.com/PSToolbar
    >>
    >>
    >> s> I'm still here with another question of mine.
    >> s> Is it possible to retrieve the list of all computers within my
    >> s> workgroup?
    >>
    >>

      My System SpecsSystem Spec

  6. #6


    Join Date : May 2008
    Posts : 88
    Vista Home Premium 32bit
    Local Time: 08:54 AM
    italy

      Thread Starter

    Re: retrieve all workgroup computers list

    Quote Originally Posted by Vadims Podans View Post
    It relies on Computer Browser mechanism?

    --
    WBR, Vadims Podans
    PowerShell blog - www.sysadmins.lv

    "Shay Levy [MVP]" <no@xxxxxx> rakstīja zi†ojumā
    "news:89228ed26408e8cb4a125dca5c17@xxxxxx"...

    > Hello sardinian_guy,
    >
    > I didn't test it... replace "WORKGROUP" with your workgroup name
    >
    > [ADSI]"WinNT://WORKGROUP" | % {$_.psbase.children }
    >
    >
    > ---
    > Shay Levy
    > Windows PowerShell MVP
    > Shay Levy
    > PowerShell Toolbar: PowerShell at the tip of your browser - Shay Levy
    >
    >
    > s> I'm still here with another question of mine.
    > s> Is it possible to retrieve the list of all computers within my
    > s> workgroup?
    >
    >
    Hi Vadims.
    Please forgive me but I didn't understand your question.

      My System SpecsSystem Spec

  7. #7


    Vadims Podans Guest

    Re: retrieve all workgroup computers list

    My question means this:
    typing [ADSI]"WinNT://WORKGROUP" we want to get a list of computers in
    workgroup. But workgroup haven't any centralized mechanism to mainatin
    actual computer list except Computer Browser service. However Browser
    service doesn't guarantee that you'll get full list of computers. For
    example, offline computers (with some exceptions) will not included in this
    list.

    If "[ADSI]"WinNT://WORKGROUP" | % {$_.psbase.children }" doesn't work, then
    try CMD command:

    # get computer list
    $a = net view
    # remove CMD technical information and
    # in Foreach-Object loop we extract computer name without "\\" prefixes.
    # NetBIOS names are limited with 15 characters (16th character determine a
    host functionality)
    $a[3..($a.length - 3)] | %{$_.substring(2,15)}

    If your network contains more than 1 workgroup, then here will need changes.
    For this command you must have correctly configured Computer Browser service
    in your network.

    I hope this helps you.

    --
    WBR, Vadims Podans
    PowerShell blog - www.sysadmins.lv

    "sardinian_guy" <guest@xxxxxx-email.com> rakstīja ziņojumā
    "news:42107cb8a7049339ddf3161aa198bff5@xxxxxx-gateway.com"...

    >
    > Vadims Podans;946151 Wrote:

    >> It relies on Computer Browser mechanism?
    >>
    >> --
    >> WBR, Vadims Podans
    >> PowerShell blog - 'www.sysadmins.lv' (http://www.sysadmins.lv)
    >>
    >> "Shay Levy [MVP]" <no@xxxxxx> rakstд╚ja ziе†ojumд│
    >> "news:89228ed26408e8cb4a125dca5c17@xxxxxx"...> > >

    >> > > Hello sardinian_guy,
    >> > >
    >> > > I didn't test it... replace "WORKGROUP" with your workgroup name
    >> > >
    >> > > [ADSI]"WinNT://WORKGROUP" | % {$_.psbase.children }
    >> > >
    >> > >
    >> > > ---
    >> > > Shay Levy
    >> > > Windows PowerShell MVP
    >> > > 'Shay Levy' (http://blogs.microsoft.co.il/blogs/ScriptFanatic)
    >> > > PowerShell Toolbar: 'PowerShell at the tip of your browser - Shay
    >> > Levy' (http://tinyurl.com/PSToolbar)
    >> > >
    >> > >
    >> > > s> I'm still here with another question of mine.
    >> > > s> Is it possible to retrieve the list of all computers within my
    >> > > s> workgroup?
    >> > >
    >> > > > >
    >
    > Hi Vadims.
    > Please forgive me but I didn't understand your question.
    >
    >
    > --
    > sardinian_guy

      My System SpecsSystem Spec

  8. #8


    Shay Levy [MVP] Guest

    Re: retrieve all workgroup computers list

    Hello sardinian_guy,

    > Eccezione durante il recupero del membro
    > "ClassId2e4f51ef21dd47e99d3c952918aff9cd": "Non implementato
    The only thing I can understand is "Non implementato"

    I can't test the code, I have no workgroup environment.
    Have you tried Vadims' suggestion?


    ---
    Shay Levy
    Windows PowerShell MVP
    http://blogs.microsoft.co.il/blogs/ScriptFanatic
    PowerShell Toolbar: http://tinyurl.com/PSToolbar


    s> Hi Shay. Thanks for your answer.
    s> Unluckily it doesn't work. It returns me this error
    s> Eccezione durante il recupero del membro
    s> "ClassId2e4f51ef21dd47e99d3c952918aff9cd": "Non implementato
    s> Since yesterday I'm looking for a solution.
    s> I've found this article
    s> 'Hey, Scripting Guy! How Can I Use Windows PowerShell to Get a List
    s> of
    s> All My Computers?'
    s> (http://www.microsoft.com/technet/scr...s/qanda/nov06/
    s> hey1109.mspx)
    s> but it concerns with domain
    s>
    s> and even this thread
    s> http://www.vistax64.com/powershell/1...sting-microsof
    s> t-windows-networking-domains-workgroups.html
    s>
    s> where your code
    s>
    s> [ADSI]"WinNT:"|% {$_.psbase.children } |%
    s> {$_.psbase.path.substring(8)}
    s>
    s> returns the right workgroup name but I'm not able to list my pcs.
    s>
    s> edit. If I just write
    s>
    s> [ADSI]"WinNT://myworkgroup"
    s>
    s> powershell doesn't return any error but a column "distinguishedname"
    s> without any value.
    s>



      My System SpecsSystem Spec

  9. #9


    Join Date : May 2008
    Posts : 88
    Vista Home Premium 32bit
    Local Time: 08:54 AM
    italy

      Thread Starter

    Re: retrieve all workgroup computers list

    Hi guys. Vadims' advice works well.
    I've tried his code at home where I have two computers. Today I'm sick but yesterday morning I've tried net view at work. There were three pcs and I remember that the command returns me four results, three computer names and an alphanumeric code. Is it possible that net view doesn't return just computer name of the workgroup but even other resources?

    @Shay. Maybe it would be better if I install english version of powershell so that everybody can understand my error messages.

      My System SpecsSystem Spec

  10. #10


    Vadims Podans Guest

    Re: retrieve all workgroup computers list

    Net View returns only available workgroups names (if in one physical segment
    exist more than one workgroup) and computers in current workgroup (in which
    is joined computer). Also ouput may contain (not neccessary) the computer
    role in current workgroup. They are described here:
    http://support.microsoft.com/kb/163409

    At this time I have only one network with Computer Browser service enabled
    and I don't see alphanumeric codes. Can you provide your net view command
    output?

    about english powershell - at this time it is not neccessary, because
    running Shay's command I get the same error (in v1.0 and v2 CTP3):

    [vPodans] [ADSI]"WinNT://WORKGROUP" | % {$_.psbase.children }
    format-default : Exception retrieving member "PSComputerName": "Not
    implemented
    "
    + CategoryInfo : NotSpecified: ( [format-default],
    ExtendedTypeSystemException
    + FullyQualifiedErrorId :
    CatchFromBaseGetMember,Microsoft.PowerShell.Commands.FormatDefaultCommand

    --
    WBR, Vadims Podans
    PowerShell blog - www.sysadmins.lv

    "sardinian_guy" <guest@xxxxxx-email.com> rakstīja ziņojumā
    "news:cd120599e59627b11cf835cd2c641546@xxxxxx-gateway.com"...

    >
    > Hi guys. Vadims' advice works well.
    > I've tried his code at home where I have two computers. Today I'm sick
    > but yesterday morning I've tried net view at work. There were three pcs
    > and I remember that the command returns me four results, three computer
    > names and an alphanumeric code. Is it possible that net view doesn't
    > return just computer name of the workgroup but even other resources?
    >
    > @Shay. Maybe it would be better if I install english version of
    > powershell so that everybody can understand my error messages.
    >
    >
    > --
    > sardinian_guy

      My System SpecsSystem Spec

Page 1 of 2 12 LastLast
retrieve all workgroup computers list problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve Remote Registry Key from netowrk computers Andy1974 PowerShell 12 29 Jul 2009
Workgroup Computers michael.comperchio Vista General 1 18 May 2009
Cannot see workgroup computers wrtbd Vista networking & sharing 36 09 Dec 2007
Seeing other computers in workgroup Stegura Vista networking & sharing 9 07 Aug 2007
can't se computers on workgroup dimitri Vista networking & sharing 0 22 Feb 2007