Solved

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

Posted on 2003-12-09
14
25,510 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
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 

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
 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sonicwall AP 3 65
Win10 RDP Disconnect/can't reconnect 5 86
Running VB/Batch script through Group policy 30 117
Network status says no internet, but this is incorrect 1 39
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…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 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