Link to home
Start Free TrialLog in
Avatar of BLACK THANOS
BLACK THANOSFlag for United States of America

asked on

How do I set up a Windows 7 Home network via vbscript

Good evening Experts,
I am managing over 80 machines in a Workgroup environment, and I went through the tedious task of setting up all of the machines manually to a homegroup to provide file and print sharing capabilities. For some unknown reason, the machines in my technology center all defaulted back to a public network. this had the affect of an access denied being given whenever I run any of my scripts against remote machines from my computer. I dont want have to manuallty redo all the home network settings. Is there a command or vbscript that allows me to change the settings in the images below?

 User generated image User generated image User generated image
Avatar of bigeven2002
bigeven2002
Flag of United States of America image

Hello,

Honestly I don't think there is any vbscripts to help you here.  However, there may be a PowerShell script that can.  This link might be able to help you:

http://blogs.msdn.com/b/dimeby8/archive/2009/06/10/change-unidentified-network-from-public-to-work-in-windows-7.aspx

What version of Windows 7 are the PCs running?  Homegroup was not really meant for that many PCs.  If your Win7 versions are Professional or Ultimate, then you should consider investing in Windows Server 2008 R2 and creating an Active Directory domain for that many PCs.  It will handle all your permissions for you and supports logon scripts.
Avatar of BLACK THANOS

ASKER

Hi bigeven2002,

therin lies my problem, The Boys and Girls Club of Monterey County is a non-profit organization and they dont have the resources to go to a domain based environment for the youth pc's, or I would have configured Active Directory and used Group policy for all of my needs, but , alas , I am not able to so. But thank you for your input.
Hi REGISHYDE,

First I think we need to work out why the home has stopped working. On one of the PC's thats not working can you please check if the following services are running?

HomeGroup Listener
HomeGroup Provider

You can check this by running services.msc on one of the affected pc's.
Thanks for the input CharlWiehahn,

The services are running. For completeness, I would like to add that I can easily RDP into each of the machines and rejoin them toe home network, but that is what I wanted to avoid. To clarify, I am only interested in a solution that will allow me to programmatically change the options mentioned in the images above, whether it be vbscript, batch file, group policy, etc....
Avatar of David Johnson, CD
I would suggest rather than a home network set them to work network.
ve3ofa, please justify your suggestion
80 machines vs the maybe 5 in a normal families homegroup. which means that now each machine will poll the other 79 machines libraries and add the information to their libraries (so this will be 79^2 times that the information is requested and indexed) x the 5 items you are sharing.

I'm rather surprised that the 20 connection limit per machine hasn't been a problem or perhaps it is a problem that you are just not aware of right now this could be why homegroup is not working right for you as machines will be appearing and disappearing at random as the 20 connection limit hits each machine.

With a workgroup the resource will only be accessed when it is directly requested by another machine and after a period of inactivity the resource will be released so that another computer can access the data

Perhaps something like freenas would be a better solution, just copy all of the files from the libraries to the NAS (network attached storage) add the nas share to the libraries as the default save location and you have the same results that you have now without the 20 connection limit example setup for a freenas is here
I am fully aware of the 20 connection limit imposed by Windows 7, and yes, this is another problem that I was going to address in this forume, but you have adequately given me a solution for the limitation. However, this does not answer my original question. Please review the orginal question about programmaticlly modifying the advanced sharing options. For completeness, your assessment about moving from home to work network does not allievate the 20 connection limit. Your aforementioned suggestion about the NAS solution will be utilized. How can I give you 500 points for that, becuase you deserve it.
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ve3ofa,

I have been looking for the relevant registry keys for the last 2 days with no success, should have thought of netsh in the first place. Well done :)

@REGISHYDE

If you add the commands supplied by ve3ofa to a batch file, then you can remotely execute it on all 80 pc's using the psexec utiilty thats part of the PSTools suite and can be downloaded from the microsoft website.

User the -c switch and specify the batch file. That way Psexec will copy the file to the remote computer and run it. You would also need to specify the local admin username and password when using this utility.
CharlWiehahn,
I am fully conversant with Psexec. I even posted a question in this forum about its usage, becuase it was giving me such a headache to set up. I will re-visit Psexec and use it with ve3ofas suggestion.
stay tuned...
I am awarding ve3ofa: the points based upon his solution to use netsh to change settings under homegroup