Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

retrieve all workgroup computers list

1,188 views
Skip to first unread message

sardinian_guy

unread,
Jan 21, 2009, 11:37:57 AM1/21/09
to

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


--
sardinian_guy

Shay Levy [MVP]

unread,
Jan 21, 2009, 12:05:31 PM1/21/09
to
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?


Vadims Podans

unread,
Jan 21, 2009, 12:39:48 PM1/21/09
to
It relies on Computer Browser mechanism?

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

"Shay Levy [MVP]" <n...@addre.ss> rakstīja ziņojumā
"news:89228ed26408e8...@news.microsoft.com"...

Lognoul Marc [MVP]

unread,
Jan 21, 2009, 12:45:12 PM1/21/09
to
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...@TK2MSFTNGP05.phx.gbl...

sardinian_guy

unread,
Jan 21, 2009, 12:33:24 PM1/21/09
to

Hi Shay. Thanks for your answer. :D
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?'
(http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1109.mspx)

but it concerns with domain

and even this thread
http://www.vistax64.com/powershell/186286-powershell-listing-microsoft-windows-networking-domains-workgroups.html


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.


--
sardinian_guy

sardinian_guy

unread,
Jan 21, 2009, 12:49:15 PM1/21/09
to

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Å&#8224;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. :o


--
sardinian_guy

Vadims Podans

unread,
Jan 21, 2009, 2:39:16 PM1/21/09
to
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" <gu...@unknown-email.com> rakstīja ziņojumā
"news:42107cb8a7049339...@nntp-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е&#8224;ojumд│

Shay Levy [MVP]

unread,
Jan 22, 2009, 5:26:42 AM1/22/09
to
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


s> Hi Shay. Thanks for your answer. :D
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/scriptcenter/resources/qanda/nov06/
s> hey1109.mspx)
s> but it concerns with domain
s>
s> and even this thread
s> http://www.vistax64.com/powershell/186286-powershell-listing-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>


sardinian_guy

unread,
Jan 22, 2009, 7:02:40 AM1/22/09
to

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. :D


--
sardinian_guy

Vadims Podans

unread,
Jan 22, 2009, 7:28:21 AM1/22/09
to

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" <gu...@unknown-email.com> rakstīja ziņojumā
"news:cd120599e59627b1...@nntp-gateway.com"...

sardinian_guy

unread,
Jan 22, 2009, 8:18:15 AM1/22/09
to

As soon as I feel better (I'll come back at work next monday :)) I'll
run again the command net view and I'll provide you the right output.
For the moment thank you very much for your precious helps. I've never
seen a forum with so much skilled and kind users. Regards, Nicola. :)


--
sardinian_guy

sardinian_guy

unread,
Jan 26, 2009, 4:57:11 AM1/26/09
to

Today I come back to work and I tried net view.
There are four computers connected to my workgroup and I see them all.
One computer name is YOUR-6CAA.....
This is the alphanumeric string I remembered. :D
Everything works fine. Thank you very much to everybody. Nicola


--
sardinian_guy

Vadims Podans

unread,
Jan 26, 2009, 7:08:39 AM1/26/09
to
> One computer name is YOUR-6CAA.....
looks like no one has changed the default name during installation.

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

"sardinian_guy" <gu...@unknown-email.com> rakstīja ziņojumā
"news:a218d94f0f3d3bcb...@nntp-gateway.com"...

sardinian_guy

unread,
Jan 26, 2009, 7:26:23 AM1/26/09
to

Vadims Podans;950697 Wrote:
> > One computer name is YOUR-6CAA.....
> looks like no one has changed the default name during installation.
>
> --
> WBR, Vadims Podans
> PowerShell blog - 'www.sysadmins.lv' (http://www.sysadmins.lv)
>
> "sardinian_guy" <gu...@xxxxxx-email.com> rakstīja ziņojumā
> "news:a218d94f0f3d3bcb...@xxxxxx-gateway.com"...> > >
> > >
> > > Today I come back to work and I tried net view.
> > > There are four computers connected to my workgroup and I see them
> > all.
> > > One computer name is YOUR-6CAA.....
> > > This is the alphanumeric string I remembered. :D
> > > Everything works fine. Thank you very much to everybody. Nicola
> > >
> > >
> > > --
> > > sardinian_guy > >

You're right Vadims. It's the name of the laptop of my boss.
Thanks again for your help. Have a nice day. :)


--
sardinian_guy

0 new messages