--
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?
--
WBR, Vadims Podans
PowerShell blog - www.sysadmins.lv
"Shay Levy [MVP]" <n...@addre.ss> rakstīja ziņojumā
"news:89228ed26408e8...@news.microsoft.com"...
--
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...
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
Hi Vadims. :)
Please forgive me but I didn't understand your question. :o
--
sardinian_guy
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е†ojumд│
> 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. :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>
@Shay. Maybe it would be better if I install english version of
powershell so that everybody can understand my error messages. :D
--
sardinian_guy
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
--
sardinian_guy
--
WBR, Vadims Podans
PowerShell blog - www.sysadmins.lv
"sardinian_guy" <gu...@unknown-email.com> rakstīja ziņojumā
"news:a218d94f0f3d3bcb...@nntp-gateway.com"...
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