configurating windows 10 network share through .bat file

Page 3 of 3 FirstFirst 123

  1. Posts : 785
    Windows 7
       #21

    In order to correctly translate DisplayGroup names across different locales, you need to know their Group strings.
    Code:
    Get-NetFirewallRule | where { $_.DisplayGroup -match 'Network Discovery|File and Printer Sharing' } | select -Unique DisplayGroup,Group
    
    DisplayGroup                            Group
    ------------                            -----
    Wi-Fi Direct Network Discovery          @FireWallAPI.dll,-36851
    Network Discovery                       @FireWallAPI.dll,-32752
    File and Printer Sharing                @FireWallAPI.dll,-28502
    File and Printer Sharing over SMBDirect @FireWallAPI.dll,-28602

    Enabling Network Discovery (-32752) and File and Printer Sharing (-28502) rules in any Windows language:
    Code:
    Set-NetFirewallRule -DisplayGroup (Get-NetFirewallRule | where { $_.Group -match '-32752' } | select -Unique DisplayGroup,Group).DisplayGroup -Enabled True -Profile Private
    Set-NetFirewallRule -DisplayGroup (Get-NetFirewallRule | where { $_.Group -match '-28502' } | select -Unique DisplayGroup,Group).DisplayGroup -Enabled True -Profile Private
      My Computer


  2. Posts : 16,963
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #22

    jhugor,

    I used their Group strings to find the correct Portuguese DisplayGroup names but garlin's solution is much neater since it avoids the need to investigate using that long output list you posted.


    Denis
      My Computer


  3. Posts : 14
    w10
    Thread Starter
       #23

    Try3 said:
    Not
    Code:
    -Profile Private, Public"
    but
    Code:
    -Profile Private,Public"

    Denis
    denis, the spacing worked here

    tks

    - - - Updated - - -

    garlin said:
    In order to correctly translate DisplayGroup names across different locales, you need to know their Group strings.
    Code:
    Get-NetFirewallRule | where { $_.DisplayGroup -match 'Network Discovery|File and Printer Sharing' } | select -Unique DisplayGroup,Group
    
    DisplayGroup                            Group
    ------------                            -----
    Wi-Fi Direct Network Discovery          @FireWallAPI.dll,-36851
    Network Discovery                       @FireWallAPI.dll,-32752
    File and Printer Sharing                @FireWallAPI.dll,-28502
    File and Printer Sharing over SMBDirect @FireWallAPI.dll,-28602

    Enabling Network Discovery (-32752) and File and Printer Sharing (-28502) rules in any Windows language:
    Code:
    Set-NetFirewallRule -DisplayGroup (Get-NetFirewallRule | where { $_.Group -match '-32752' } | select -Unique DisplayGroup,Group).DisplayGroup -Enabled True -Profile Private
    Set-NetFirewallRule -DisplayGroup (Get-NetFirewallRule | where { $_.Group -match '-28502' } | select -Unique DisplayGroup,Group).DisplayGroup -Enabled True -Profile Private
    WOW

    TKS

    - - - Updated - - -

    Try3 said:
    jhugor,

    I used their Group strings to find the correct Portuguese DisplayGroup names but garlin's solution is much neater since it avoids the need to investigate using that long output list you posted.


    Denis
    its really, fantastic.

    - - - Updated - - -

    ok so far, thank you all very much! I'm actually impressed by how willing you are to help! I hope one day to be as useful as this to others! Just to summarize, I'm still trying to solve what follows. If I can get it from other sources and test it and it works, I'll update it here!



    thank you very much

    - - - Updated - - -

    garlin said:
    In order to correctly translate DisplayGroup names across different locales, you need to know their Group strings.
    Code:
    Get-NetFirewallRule | where { $_.DisplayGroup -match 'Network Discovery|File and Printer Sharing' } | select -Unique DisplayGroup,Group
    
    DisplayGroup                            Group
    ------------                            -----
    Wi-Fi Direct Network Discovery          @FireWallAPI.dll,-36851
    Network Discovery                       @FireWallAPI.dll,-32752
    File and Printer Sharing                @FireWallAPI.dll,-28502
    File and Printer Sharing over SMBDirect @FireWallAPI.dll,-28602

    Enabling Network Discovery (-32752) and File and Printer Sharing (-28502) rules in any Windows language:
    Code:
    Set-NetFirewallRule -DisplayGroup (Get-NetFirewallRule | where { $_.Group -match '-32752' } | select -Unique DisplayGroup,Group).DisplayGroup -Enabled True -Profile Private
    Set-NetFirewallRule -DisplayGroup (Get-NetFirewallRule | where { $_.Group -match '-28502' } | select -Unique DisplayGroup,Group).DisplayGroup -Enabled True -Profile Private
    I come to share the information that the comment below

    Get-NetFirewallRule | where { $_.DisplayGroup -match 'Descoberta de Rede|Compartilhamento de arquivo e impressora' } | select -Unique DisplayGroup,Group
    It only works if I use the words in my language

    In other words, if I needed to discover the codes myself, I would have to know the displaygroup in my language, which would soon end up having no effect.

    Maybe future, perhaps in the future it will not be possible to use all commands in English (I mean, including displaygroups and names in English)

    The point is that it's not just me who uses the PC and in this case it is necessary for it to remain in the local native language


      My Computer


  4. Posts : 785
    Windows 7
       #24

    Sorry, the first set of PS commands are for @hsehestedt

    Since he's writing a script in English, he needs to need know how to replace DisplayGroup with Group strings. As an end-user, you only need to run the second set of commands.
      My Computer


  5. Posts : 14
    w10
    Thread Starter
       #25

    garlin said:
    Sorry, the first set of PS commands are for @hsehestedt

    Since he's writing a script in English, he needs to need know how to replace DisplayGroup with Group strings. As an end-user, you only need to run the second set of commands.
    Don't apologize, I appreciate it, I'm learning, I used them in PS and it worked.

    tks
      My Computer


  6. Posts : 16,963
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #26

    jhugor said:
    the spacing worked here
    Interesting. The MS article I studied & gave you a link to
    specifically says not to include any spaces.
    MS said:
    Separate multiple entries with a comma and do not include any spaces
    So thank you for that information.


    Denis
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:12.
Find Us




Windows 10 Forums