?
Solved

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

Posted on 2011-10-21
12
Medium Priority
?
595 Views
Last Modified: 2012-05-12
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?

 ChangeHomeGroupSettings ChangeHomeGroupSettings1 ChangeHomeGroupSettings2
0
Comment
Question by:BLACK THANOS
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 17

Expert Comment

by:bigeven2002
ID: 37010229
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.
0
 

Author Comment

by:BLACK THANOS
ID: 37010355
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.
0
 
LVL 4

Expert Comment

by:CharlWiehahn
ID: 37010694
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.
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 

Author Comment

by:BLACK THANOS
ID: 37012402
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....
0
 
LVL 84

Expert Comment

by:David Johnson, CD, MVP
ID: 37013332
I would suggest rather than a home network set them to work network.
0
 

Author Comment

by:BLACK THANOS
ID: 37014216
ve3ofa, please justify your suggestion
0
 
LVL 84

Expert Comment

by:David Johnson, CD, MVP
ID: 37014908
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
0
 

Author Comment

by:BLACK THANOS
ID: 37015665
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.
0
 
LVL 84

Accepted Solution

by:
David Johnson, CD, MVP earned 2000 total points
ID: 37015788
netsh firewall set service type=fileandprint mode=enable profile=all
# Allow File and Printer Sharing
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
# Allow Remote Desktop
netsh advfirewall firewall set rule group="Remote Desktop" new enable=Yes
net share c:\public /grant:guest FULL
sc config wmpnetworksvc start=auto
sc start wmpnetworksvc
0
 
LVL 4

Expert Comment

by:CharlWiehahn
ID: 37017668
@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.
0
 

Author Comment

by:BLACK THANOS
ID: 37022125
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...
0
 

Author Comment

by:BLACK THANOS
ID: 37098164
I am awarding ve3ofa: the points based upon his solution to use netsh to change settings under homegroup
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question