enable file and print sharing remotely

G

Guest

I have a bunch of PCs on our network where the user has unchecked file and
print sharing. There are applications we run that require this to be enabled.
Is there any way to enable it remotely if I have admin rights on the PC? If
not, is there a way to remotely detect whether or not it has been unchecked
so I can run a login script to reinstall using snetcfg.exe without effecting
those who already have it enabled?
 
J

Jerold Schulman

I have a bunch of PCs on our network where the user has unchecked file and
print sharing. There are applications we run that require this to be enabled.
Is there any way to enable it remotely if I have admin rights on the PC? If
not, is there a way to remotely detect whether or not it has been unchecked
so I can run a login script to reinstall using snetcfg.exe without effecting
those who already have it enabled?

See tip 4705 » Freeware app installs network components from a Windows 2000 (only) command line.
in the 'Tips & Tricks' at http://www.jsifaq.com

@echo off
setlocal
set shr=File and Printer Sharing for Microsoft Networks
set OK=N
for /f "Tokens=*" %%a in ('snetcfg -s n^|find /i "%shr%"') do (
set OK=Y
)
if "%OK%" EQU "Y" endlocal&goto :EOF
:: Install File and Printer Sharing for Microsoft Networks here.
endlocal

You could run this remotely using tip 4141 » PsExec freeware executes programs remotely.

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
G

Guest

Actually I already found that information online... The problem is that
psexec doesn't work cause It doesn't find the computer on the network with
file and print sharing unchecked. I would like to run the uninstall/reinstall
via snetcfg.exe through some type of login script. Since this only affects
about 40 of 4000 workstations I do not want it run on all of them. I am
trying to find a way to identify which PCs have the file and print sharing
unchecked, I am assuming there is something in the registry I can have my
login script check for I just haven't been able to identify what that may be.
Any thoughts?
 
J

Jerold Schulman

Actually I already found that information online... The problem is that
psexec doesn't work cause It doesn't find the computer on the network with
file and print sharing unchecked. I would like to run the uninstall/reinstall
via snetcfg.exe through some type of login script. Since this only affects
about 40 of 4000 workstations I do not want it run on all of them. I am
trying to find a way to identify which PCs have the file and print sharing
unchecked, I am assuming there is something in the registry I can have my
login script check for I just haven't been able to identify what that may be.
Any thoughts?

Use a startup script:

@echo off
setlocal
set shr=File and Printer Sharing for Microsoft Networks
set OK=N
for /f "Tokens=*" %%a in ('snetcfg -s n^|find /i "%shr%"') do (
set OK=Y
)
if "%OK%" EQU "Y" endlocal&goto :EOF
:: Install File and Printer Sharing for Microsoft Networks here.
endlocal


Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
G

Guest

Thank you! This will work great for any that have had File and Print Sharing
uninstalled, so it will probably fix some of them. Any thoughts on how to
detect the ones where File and Print Sharing is installed but has been
unchecked?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top