Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Shutdown script doesn't do anything

HTVi
TV Discussion Newsgroups

Shutdown script doesn't do anything
greenbeer77[ at ]gmail.com 4/17/2007 4:29:37 PM
I have a Windows 2k3 Active Directory in native mode and Win2k and XP
clients. I have written a vb script that will detect a drive mapping
to U: and if it is there, replace it with a new mapping or add the
drive mapping if one does not exist. I tested the script and it works
if I run it when I'm logged into windows as a user with very little
network access. When I try to run it as a shutdown script, it does
show that a shutdown script is running, but when I log in again, my
old drive mapping is still there. I've been testing by mapping the
drive incorrectly and rebooting. The Group Policy is applying, but
the desired result is not being met.

Any thoughts?

Re: Shutdown script doesn't do anything
"Richard Mueller [MVP]" <rlmueller-nospam[ at ]ameritech.nospam.net> 4/17/2007 5:25:26 PM

<greenbeer77[ at ]gmail.com> wrote in message
news:1176827377.174010.153970[ at ]o5g2000hsb.googlegroups.com...
[Quoted Text]
>I have a Windows 2k3 Active Directory in native mode and Win2k and XP
> clients. I have written a vb script that will detect a drive mapping
> to U: and if it is there, replace it with a new mapping or add the
> drive mapping if one does not exist. I tested the script and it works
> if I run it when I'm logged into windows as a user with very little
> network access. When I try to run it as a shutdown script, it does
> show that a shutdown script is running, but when I log in again, my
> old drive mapping is still there. I've been testing by mapping the
> drive incorrectly and rebooting. The Group Policy is applying, but
> the desired result is not being met.
>
> Any thoughts?
>

When a Shutdown (or Startup) script runs, there is no user. I don't see how
a drive mapping could apply, since the mapping is for the current user. I
would do this in a logon script. There are parameters to deal with
persistent connections (remove them). In VBScript I use code similar to:

objNetwork.RemoveNetworkDrive "U:", True, True

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


Re: Shutdown script doesn't do anything
greenbeer77[ at ]gmail.com 4/17/2007 6:03:26 PM
On Apr 17, 12:25 pm, "Richard Mueller [MVP]" <rlmueller-
nos...[ at ]ameritech.nospam.net> wrote:
[Quoted Text]
> <greenbee...[ at ]gmail.com> wrote in message
>
> news:1176827377.174010.153970[ at ]o5g2000hsb.googlegroups.com...
>
> >I have a Windows 2k3 Active Directory in native mode and Win2k and XP
> > clients. I have written a vb script that will detect a drive mapping
> > to U: and if it is there, replace it with a new mapping or add the
> > drive mapping if one does not exist. I tested the script and it works
> > if I run it when I'm logged into windows as a user with very little
> > network access. When I try to run it as a shutdown script, it does
> > show that a shutdown script is running, but when I log in again, my
> > old drive mapping is still there. I've been testing by mapping the
> > drive incorrectly and rebooting. The Group Policy is applying, but
> > the desired result is not being met.
>
> > Any thoughts?
>
> When a Shutdown (or Startup) script runs, there is no user. I don't see how
> a drive mapping could apply, since the mapping is for the current user. I
> would do this in a logon script. There are parameters to deal with
> persistent connections (remove them). In VBScript I use code similar to:
>
> objNetwork.RemoveNetworkDrive "U:", True, True
>
> --
> Richard Mueller
> Microsoft MVP Scripting and ADSI
> Hilltop Lab -http://www.rlmueller.net
> -

Ok, that's what I was thinking, but I wasn't sure.


Re: Shutdown script doesn't do anything
greenbeer77[ at ]gmail.com 4/17/2007 8:38:49 PM
On Apr 17, 12:25 pm, "Richard Mueller [MVP]" <rlmueller-
nos...[ at ]ameritech.nospam.net> wrote:
[Quoted Text]
> <greenbee...[ at ]gmail.com> wrote in message
>
> news:1176827377.174010.153970[ at ]o5g2000hsb.googlegroups.com...
>
> >I have a Windows 2k3 Active Directory in native mode and Win2k and XP
> > clients. I have written a vb script that will detect a drive mapping
> > to U: and if it is there, replace it with a new mapping or add the
> > drive mapping if one does not exist. I tested the script and it works
> > if I run it when I'm logged into windows as a user with very little
> > network access. When I try to run it as a shutdown script, it does
> > show that a shutdown script is running, but when I log in again, my
> > old drive mapping is still there. I've been testing by mapping the
> > drive incorrectly and rebooting. The Group Policy is applying, but
> > the desired result is not being met.
>
> > Any thoughts?
>
> When a Shutdown (or Startup) script runs, there is no user. I don't see how
> a drive mapping could apply, since the mapping is for the current user. I
> would do this in a logon script. There are parameters to deal with
> persistent connections (remove them). In VBScript I use code similar to:
>
> objNetwork.RemoveNetworkDrive "U:", True, True
>
> --
> Richard Mueller
> Microsoft MVP Scripting and ADSI
> Hilltop Lab -http://www.rlmueller.net
> --

I am trying to go in a different direction with this script.
Ultimately, I am trying to get rid of McAfee and install Trend. It's
a WAN environment and Trend doesn't have much for deployment over a
wan. So, I'm trying to do it using Group Policy. I've tried using an
MSI package and deploying that using the software installation section
under computer settings. That attempt just put the MSI file in add
remove programs on all the pc's, without actually installing Trend or
removing McAfee. So, now I have written a script that will just call
trend.exe, which is the setup program, and I'd like to use it as a
shutdown script.

I tested it out on a Win2k pro client and when I shut down, it said
that the shutdown script was running, then it went to shutting down
the computer right away. When it started back up, McAfee was still
there and Trend was not. I have tested the trend.exe from inside
Windows and it runs just fine as long as I am in windows.

Here is the script:

Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "c:\trend.exe"
WScript.Quit

I looked in Event Viewer and there is nothing in there about the
shutdown script.


Re: Shutdown script doesn't do anything
"Richard Mueller [MVP]" <rlmueller-nospam[ at ]ameritech.nospam.net> 4/18/2007 7:09:51 PM
[Quoted Text]
> I am trying to go in a different direction with this script.
> Ultimately, I am trying to get rid of McAfee and install Trend. It's
> a WAN environment and Trend doesn't have much for deployment over a
> wan. So, I'm trying to do it using Group Policy. I've tried using an
> MSI package and deploying that using the software installation section
> under computer settings. That attempt just put the MSI file in add
> remove programs on all the pc's, without actually installing Trend or
> removing McAfee. So, now I have written a script that will just call
> trend.exe, which is the setup program, and I'd like to use it as a
> shutdown script.
>
> I tested it out on a Win2k pro client and when I shut down, it said
> that the shutdown script was running, then it went to shutting down
> the computer right away. When it started back up, McAfee was still
> there and Trend was not. I have tested the trend.exe from inside
> Windows and it runs just fine as long as I am in windows.
>
> Here is the script:
>
> Option Explicit
> Dim objShell
> Set objShell = CreateObject("WScript.Shell")
> objShell.Run "c:\trend.exe"
> WScript.Quit
>
> I looked in Event Viewer and there is nothing in there about the
> shutdown script.
>

I have had success remotely installing some applications using WMI, although
it took awhile to figure out all the details. Of course, you must have
administrator privileges on all the computers, but a member of Domain Admins
should by default be a member of the local Administrators group on every
computer joined to the domain. I have a VBScript program to deploy
patches/updates/applications linked here:

http://www.rlmueller.net/Deploy.htm

This program deploys to all computers in a group. The executable deployed
must be able to run unattended. Another option is SMS.

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen