Solved

Enable File And Print Sharing for Microsoft Networks with a WMI WSH VBScript

Posted on 2003-12-09
14
25,420 Views
Last Modified: 2012-06-27
A RIS (Disc) image went out that did not have "File and Print Sharing for Microsoft Networks" turned on! Oh NO! Now I want to fix it with a script deployed with SMS.

I want to be able to turn on (enable) "File and Print Sharing for Microsoft Networks" in my network adaptor configuration, and do it with a VBScript.

Looking at the "Win32_NetworkAdapterConfiguration " I dont see how I can turn this on.

I can do things like set DNS and WINS servers and other nifty stuff like that, but there is appearently no methods for turning this componant on thru this interface.

Has anyone ever done this sort of scripting?

OS: Windows 2000 Advanced Servers & Windows XP Pro clients
0
Comment
Question by:ridgewnd
14 Comments
 

Author Comment

by:ridgewnd
ID: 9941400
Well having researched this for about a week I'm finding that this cannot be done with just a simple script. There is no simple method. When FPS is installed on a machine but not enabled, the simple act of enabling FPS (no reboot needed) causes some (very large)  REG_BINARY changes in the registry that have not been easy (for me anyway) to reverse engineer.
0
 

Author Comment

by:ridgewnd
ID: 9949066
OK, it occurs to me that maybe there is another way to ask this question.

This is a large organization with over 100,000 WinXP, Win2K, WinNT under remote management using the world largest intranet.

I have a Windows XP Professional Service Pack 1 machine that was shipped to users with File and Print Services installed but not enabled (The check mark is not checked), in the Local Area Connection Properties. BTW, the only other Componants installed and checked are Client for Microsoft Networks, and TCP/IP.

These machines (10,000+ dial-up) are remote to my location, we wont be flying people anywhere just to turn this option on.

How can this function be enabled remotely so that we dont have to ask the users to do it themselves?


0
 

Author Comment

by:ridgewnd
ID: 9982809
Since these are dial-up machines that I'm dealing with, I have found out that a file called the Rasphone.pbk located in the "Documents and Settings\%UserName%\Application Data\Microsoft\Network\Connections\Pbk\" directory.
This file has two entries that I believe will do the job.
ShardMsFilePrint=1, and
ms_server=1.
I will test this tommorrow.
0
 

Author Comment

by:ridgewnd
ID: 9992521
I tested this and it works. Thats was so easy once I found out about the Rasphone.pbk file.

Now (someday anyway) figure out how to do this with a LAN connection.

0
 
LVL 5

Accepted Solution

by:
zenlion420 earned 0 total points
ID: 9992732
PAQd and points refunded (500)

zenlion420
EE Page Editor
0
 

Expert Comment

by:rhumphries_lumley
ID: 10221688
This can be done by copying snetcfg_wxp.exe from the Win2003 res kit (I think) then running 2 DOS commands within a script..

snetcfg_wxp -u MS_Server
snetcfg_wxp -c s -i MS_Server

This disables then enables the File and Printer Sharing for Microsoft Networks settings.  (doesn't appear to work without the disable).
0
 

Expert Comment

by:nabeelm2003
ID: 10390799

uninstalling the MS_server and installing it again works.

However, I don't want to take such action unless File & Printer Sharing is disabled. I could not find a way to check on the status of File & Printer Sharing whether it is enabled or disabled using the snetcfg_wxp tool.



0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

Expert Comment

by:outlander0088
ID: 10440904
Has anyone been able to get this working on LAN connections?  I am in the same situation, have file and print installed but not checked/enabled.  I need to enable/disable it via login scripts.
0
 

Expert Comment

by:BDBartlett
ID: 10681192
I am new and just joined because I found this question on a search. I need the answer. I knew about the rasphone.pbk file but need a lan solution and not by login in scripts either.

The solution title (Enable File And Print Sharing for Microsoft Networks with a WMI WSH VBScript) implies a scripting solution, yet the "Accepted Answer" says "PAQd and points refunded (500)". and the "comment" following that references a solution with an EXE that does not exist in my Win2003 server Resource kit.

Is there an answer for my $9.95 signup fee?    :)
0
 

Expert Comment

by:BDBartlett
ID: 10681972
This is what I payed 10 bucks for.  A few caveats:
the text is wrong it does NOT enable\disable FPS it uninstalls and then re-installs the Server Service (lanmanserver). It removes and installs the FPS network component and then enables it.
It also deletes the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer
key and thus any shares because they are at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares

So it would be wise to save the lanmanserver key and copy back anything that needs to be saved. I lost 25 shares that I now have to recreate, thank goodness for documentation and test environments. It does not work remotely so would have to be used in a logon script very judiciously. The install command line is wrong it should be:
snetcfg_wxp -l c:\winnt\inf\netserv.inf -c s -i MS_Server

It is not a 2003 Resource kit tool because I have it (the RK) installed and snetcfg_wxp did not exist on my HD until I went to the link below.

http://www.jsiinc.com/dl/snetcfg_wxp.zip
0
 

Expert Comment

by:yene
ID: 23397858
I am still in the sam esituation .Does anybody found out how to enable and disable file and printer sharing using powershell script !!
Thanks
0
 
LVL 1

Expert Comment

by:Dan_Mahoney
ID: 23514387
I've just found this article. I haven't tested it yet but this looks hopeful.
http://www.intelliadmin.com/blog/index.php/2008/12/enable-file-and-printer-sharing-using-group-policy-2/
0
 

Expert Comment

by:h2odata2
ID: 34428689
There is a better way then to use snetcfg as you have to uninstall and reinstall MS_Server to make it work, I had the same problem so made a powershell script with the help of nvspbind.

Made a script and a guide, hope it helps!

http://microsoftis.com/2010/12/27/how-to-enable-file-and-printer-sharing-for-microsoft-networks-on-nic-with-powershell-2/
0
 

Expert Comment

by:driden
ID: 34928430
I've had good luck with the following:

Myshell.run "netsh firewall set service type=FILEANDPRINT mode=enable"
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Have you ever set up your wireless router at home or in the office to find that you little pop-up bubble in the bottom right-hand corner of Windows read "IP Conflict - One of more computers on the network have been assigned the following IP address"…
The Need In an Active Directory enviroment, the PDC emulator provide time synchronization for the domain. This is important since Active Directory uses Kerberos for authentication.  By default, if the time difference between systems is off by more …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now