Solved

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

Posted on 2003-12-09
14
25,374 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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.

Join & Write a Comment

FIPS stands for the Federal Information Processing Standardisation and FIPS 140-2 is a collection of standards that are generically associated with hardware and software cryptography. In most cases, people can refer to this as the method of encrypti…
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

13 Experts available now in Live!

Get 1:1 Help Now