Jump to content

[question] Startup/shutdown GP scripts have no network


Recommended Posts

Posted

Hi there!

I made a fancy unattended install and now wish to have my systems remotely maintained. For this reason I created a network share and a script, that checks for new "updates" on this share. If it finds a new script to be run (AKA update), it runs it.

This can be used for a variety of tasks, making system wide updates a piece of cake. SMS isn't free, so I'd prefer to use this solution.

However, I've run across a major problem. At the time, GP startup scripts run, there is no network yet. At thetime, shutdown scripts run, the network is allready offline. Logon/off scripts won't do it because of user right problems. Manually starting the network service via NET START won't work, because the service is started, but I still get an error for NET USE.

The only solution I can think of is writing a service to download update packs while the user is loged in and then run them at shutdown time.

The question is: is there ANY way to have network support with SYSTEM rights WITHOUT writing a service?

Thanks in advance

J

The script would be:

NET USE P: \\192.168.1.3\install /USER:myusername mypassword

FINDSTR /V /I /G:C:\WINDOWS\updates\updates.lst p:\update\updates.lst >%temp%\updatelist.txt
FOR /F %%I IN (%temp%\updatelist.txt) DO p:\update\%%I.cmd
del /Q %temp%\updatelist.txt
COPY /Y p:\update\updates.lst C:\WINDOWS\updates\updates.lst

NET USE P: /DELETE


Posted (edited)

You could use runonceex and autologon (with a forced reboot) as necessary, but there would be no other way I am aware of without 3rd party applications to do this during boot or shutdown. Perhaps you should consider application/update deployment software like SMS or similar.

Edited by cluberti
Posted
You could use runonceex and autologon (with a forced reboot) as necessary, but there would be no other way I am aware of without 3rd party applications to do this during boot or shutdown. Perhaps you should consider application/update deployment software like SMS or similar.

What do you mean by autologon? Wouldn't that be a security crater? Giving my users a way to have an admin account? Even if I have Windows not load the UI, they still can use Ctrl+Shift+Esc, new task to run any app they like.

So, there is no other way than writing a service... sigh... Never mind. SMS is a bit too expensive for a high school, so I guess, I'm just going to write it...

Posted

You are correct, there would be the possibility for a security hole using autologon - looks like you're stuck with writing a service if software is too expensive.

Posted

O well. I guess, I'll just have to write it. Would anyone else be interrested in such a script? Or maybe a generic script runner service? I'd be happy to help someone else out too if I'm writing this...

I just did a little digging and guess what I found: http://support.microsoft.com/kb/q137890/

It seems I can run a regular application (or in this case command line script) as a service. There is only the matter of scheduling. I somehow need to have that service start after login. But I guess, that's an issue I can fix. Maybe I don't have to write a service after all. I'll check back and tell how it worked out.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...