ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Script to edit registry setting all network profiles to private

<< < (2/3) > >>

questorfla:
...As would that 'D' word thing you're tired of us mentioning.
-Stoic Joker (April 29, 2016, 03:34 PM)
--- End quote ---
Delete user account?  :huh:
-x16wda (April 29, 2016, 07:37 PM)
--- End quote ---
Yeah  well.  I figured is was a side-swipe at the copany using a Non-Domain network but.. I kinda like "Delete the User myslef! ;).
OR maybe it is a "hint" 
or  <Donations , Dummy!>    Oops  Double 'D'

questorfla:
For the current active connection, in an elevated PowerShell console:


--- Code: PowerShell ---$net = get-netconnectionprofile;Set-NetConnectionProfile -Name $net.Name -NetworkCategory Private-4wd (April 29, 2016, 10:15 PM)
--- End quote ---

THanks again 4wd  HOW do You DO it>?  I looked evrywhere.  Posted allover Microsoft as well as every possible forum i could find.  The WORST was Spiceworks where I got nothing but a Hundred and One reasons why it was "Impossible" to do.  Or suggestons on why I needed to do it a way they KNEW how to do (none of which would work in my case anyway and I got tired of explaining that).  I figured I would have to wait for the 12 hour time difference for you to come up with the answer :)
Not Yet TESTED but I am sure it works!  Dont suppose you have the addon to make it run elevatd in the same script.  I need to put this on every system with all the other "For Emergency Click HERE" scripts.  They won't know how to open an elevated PS prompt.

<Side note:  I STILL would love a way to step through a section of registry making multiple changes where needed based on the main key and not the specific reference in it.  All of those profiles could be changed to private whether active or not and in this cae it would not have hurt anything.  If i could have determned the single active one, I would have deleted the rest on a company system and never thought twice about it.

4wd:
I looked evrywhere.-questorfla (April 29, 2016, 11:03 PM)
--- End quote ---

Except your emails for 15 December 2015 ;)

Already answered for you way back then :P

Bit shorter:


--- Code: PowerShell ---Set-NetConnectionProfile -Name (get-netconnectionprofile).Name -NetworkCategory Private
Create a shortcut, set the Target to:


--- Code: Text ---%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy bypass -Command "Set-NetConnectionProfile -Name (Get-NetConnectionProfile).Name -NetworkCategory Private | Out-Null"
Open Properties on it, set Run as administrator under Shortcut->Advanced

Shortcut attached but Windows will probably complain about it being untrusted, still you can create your own using the info in it.

questorfla:
4 WD, I sent you a few emails with attached zips withthe setup as needed to run elevated PS1 from normal batch  file. 

That was about my only contribution.  Your Original script worked and was plain to see this once i slowed it down a little  :(  I am not so "fleet of mind"
This is exactly the thing that the people on that "other forum" spent so much time telling me could not be done at all.
Thanks for the help.  If you look at what i sent, i only need the added means to input a choice of types to be used for the command and Powershell is not something i know much at all.

With that added, i ahve the perfect "portable" utility that could be used on any system for the same reasons. :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup:

questorfla:
4WD: ;D

That is what they call "Old Timers Disease" :)  Us Old Timers get to "FORget" , it is one of the benefits of age.

It also allows us to make new friends from old friends every day and even old enemies are forgotten and get a new chance.

Some become new enemies. (but only unil they are forgotten again) 
Some, though, become New friends.

Life gets to be fun again as you get to learn everything "for the first time" every every new is the First Day of the Rest of the Rest of your Life.

I have always felt that this was a good outlook to have on aging as there isn't much you can do about it and it beats the only alternative~!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version