Page 3 of 10 FirstFirst 12345 ... LastLast

  1. Joined : Oct 2013
    Posts : 17,367
    64-bit Windows 10 Pro build 15007
       2016-03-23 #20

    questorfla said: View Post
    Out of all of this, i did get the job done but due to the fact that I am constantly using different laptops or pc's or reloading the OS on one due to one thing or another, is there anything in the way of a script that I could run to simply set "all" networks to PRIVATE? Just a quick One Click and be done with it? This would not be a good idea for most people but I never use anything that is not on a private network and it has become a real drag to run secpol.msc or one fix or another to get the VPN's to show being connected on a private network.
    I may have read it above, and may have actually done it since it does now say Private but next time it happens I would like to click a script and know it happened with one click. Windows has made it SO hard to find the one place to set this which half the time isn't where it should be anyway due to UAC or other. Not to sound like a gripe but it is late and I just need that one thing done and over with
    Thanks. I am grateful for all the Help I find here
    Hello questorfla,

    If the network names will always be the same, you could create a .bat file using the PowerShell command from OPTION FOUR to do so. You would then use "Run as administrator" on the .bat file when you want to run it.

    Here's an example of the command to place in the .bat file.

    PowerShell Set-NetConnectionProfile -Name "Brink-Router3" -NetworkCategory Private
      My System SpecsSystem Spec

  2.    2016-03-23 #21

    Thanks. But I was hoping to be able to use the settings in secpol.msc but run as a batch or script. I have to do this al the time here due to the VPN setup. Every time it gets updated or put on a new system, you have maybe 2 seconds to grab the slide-out and tell it "YES Make this PC Discoverable etc..
    If you miss that one chance, or happen to click anything else before using it, almost every time it happens i have to hunt everywhere and end up changing UAC and everything else to be able to see it again.
    Since Secpol trumps the rest, I thought it might be the easiest to change unless that is not a good idea.

    Update: maybe best to be selective but it requires a powershell script i am not sure how to put together:
    this is close but not there. I am not sure how to allow the input of the variable nw

    I think maybe this works?
    the first part is to elevate the the command to run as admin


    Code:
    if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }Get-NetConnectionProfile
    $nw = Read-Host 'Input the network to set to Private'
    Set-NetConnectionProfile -InterfaceIndex $nw -NetworkCategory Private
    pause
    If so,
    My first PowerShell Script
    Always used batch
    Last edited by questorfla; 2016-03-23 at 13:26.
      My System SpecsSystem Spec


  3. Joined : Oct 2013
    Posts : 17,367
    64-bit Windows 10 Pro build 15007
       2016-03-23 #22

    I'm afraid that I don't how to do this in PowerShell to be able to help with it, but it'll be worth a try to see if it'll work.
      My System SpecsSystem Spec

  4.    2016-03-23 #23

    Oh, it works alright, much to my amazement!
    Just tested on several users. Now I need a nice interface instead of the normal "blue screen of death look" that PowerShell runs in.
    When run, it first asks the user for permission to edit the files as this is normally prevented by the security policies.
    If they say Y(yes) it displays the status of all network connections.
    WiFi, Wired, VPN etc. From this you pick the reference# for the one that is currently public that you want to be private
    type in the number of the Network Interface (6 or 10 etc) that you want to be Private and Viola'!
    Anything not desired to be changed is not.
    For me, at least, it is a perfect solution for a time consuming and annoying task.

    Now if only I could figure out how to get the PHP code in a web-hosted document indexer to open the pdf's server-side instead of downloading them by default each time one is clicked... I am WAY! off the reservation on that one. No idea at all.
      My System SpecsSystem Spec


  5. Joined : Oct 2013
    Posts : 17,367
    64-bit Windows 10 Pro build 15007
       2016-03-23 #24

    If you like, create a new thread in the Network and Sharing to see if someone may be able to further help with the script.
      My System SpecsSystem Spec


  6. Joined : Jul 2015
    Posts : 27
    Windows 7, 8.1, 10
       2016-04-10 #25

    I have one like this that started out Public.
    I had to use the PowerShell approach to change it to Private.
    HOWEVER:
    The dialogs like these:


    are MISSING ENTIRELY.

    Yet, in Control Panel \ Network and Sharing Center \ Advanced Sharing settings:
    Private (Current profile)
    Turn on network discovery IS CHECKED.

    So, it works but the expected controls are missing.....

    Now I have to wonder why that should / could be?
      My System SpecsSystem Spec


  7. Joined : Oct 2013
    Posts : 17,367
    64-bit Windows 10 Pro build 15007
       2016-04-10 #26

    Hello Fred,

    Double check to see if what's in the note box under step 7 below may be responsible.

    Network Location - Set to Private or Public in Windows 10
      My System SpecsSystem Spec


  8. Joined : Jul 2015
    Posts : 27
    Windows 7, 8.1, 10
       2016-04-10 #27

    Make This PC Discoverable is Missing Entirely


    Windows 10 / Settings / Network.... / Ethernet
    Double click on network
    Shows properties but NOT the "Make This PC Discoverable". That's missing.

    The network has been set to Private.
    Control Panel Advanced Settings shows that "Turn on network discovery" is CHECKED and it appears to be working.

    ?????
      My System SpecsSystem Spec


  9. Joined : Oct 2013
    Posts : 17,367
    64-bit Windows 10 Pro build 15007
       2016-04-10 #28

    @fred3,

    Did you check to see if what I posted above was the issue?
      My System SpecsSystem Spec


  10. Joined : Jul 2015
    Posts : 27
    Windows 7, 8.1, 10
       2016-04-10 #29

    Yes. The UAC is set to the Default which is supposed to show these things as I understand it. And that's where I found it.
      My System SpecsSystem Spec


 
Page 3 of 10 FirstFirst 12345 ... LastLast


Similar Threads
Tutorial Category
Network defaults to public
I have noticed in the last couple of builds the network defaults to public instead of private. I can see that on a tablet but not on a desktop. It is not hard to change the network to private but I wonder how the upgrade will behave on the millions...
Network and Sharing
Solved Private or Public
I just noticed in Windows defender My network is listed as public. Does it matter if my network is listed as private or public. I found how to change it if I have to. I just want to know if it matters. I don't know if this has anything to do with it...
Network and Sharing
Solved Will Local Network be designated Public unless tied to Microsoft?
I have noticed something I think is a little strange. If you install one of the later builds from offline, or where a Microsoft account is not involved, it appears your Local Network will be designated as "Public" even though the correct IP address...
Network and Sharing
How to set Windows desktop items as public or private
Source
General Support
Solved How to change network connection from Public to Private?
Does anyone know how to change the network from Public to Private in build 9926? It's defaulting to Public with network discovery turned off, etc, and I'd like to change it to Private.
Network and Sharing
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 04:01.
Find Us
Twitter Facebook Google+



Windows 10 Forums