Okay Folks:



Sir twitch a lot here is going bonkers yet again. Here is this little
script I pulled out of the Microsoft Windows 2000 scripting guide.



strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _

strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _

("SELECT * FROM Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems

objOperatingSystem.shutdown()

Next



Fine, fire this vbs puppy up and pooft, the computer shuts off. Which is
exactly what I wanted. Now what I want to do is schedule this puppy via
organizational units to apply to certain machines. Problem is that we have
a bunch of users who love to leave their computers on all night, burn out
monitors and occasionally fry their computers because of electrical
activities in the area. Okay, so I figured that a nice .bat file along the
lines of this



at.exe 21:00 every:m,t,w,th,f,s,su \\servername\sharename\shutdown.vbs



I figure this would solve the problem but it's a bit cumbersome. Does
anybody know of a way to incorporate the equivalent of an "AT" command that
would fire up at the computer startup so that the machine would know that,
hey, I need to shut myself down at XX:XX hours. The best thing to do,
ultimately, and I likely have a script for it somewhere, is that the
machines would magically turn themselves up.



I am shooting here for something that will work on the organizational unit
level, any suggestions, comments or prayers???



Regards,



Walt

Re: script scheduling in AD environment? by Ray

Ray
Mon Oct 20 20:21:22 CDT 2003


"Doc Wally" <notimeforspam@dot.net> wrote in message
news:Wf%kb.20247$My3.2119889@news4.srv.hcvlny.cv.net...

>
> at.exe 21:00 every:m,t,w,th,f,s,su \\servername\sharename\shutdown.vbs
>
The issue with this is that the AT service account is the local system
account of the machine, by default, so it will not have access (permissions)
to the share on the server. So, you can either change the AT account to run
under a domain account and give that account permissions to access that .vbs
file, or you can put this .vbs file on every computer on the network and
just execute it locally. Both of these options sound like a PITA, though.

If it were me, I'd setup a job to run on a server that would use
shutdown.exe from the Resource Kit. I'd just do it in a .bat file.
Something like:

for /f "skip=3" %%j in ('net view') do (shutdown %%j /t:1 /C)

Now, you'd probably want to modify that a bit so that this doesn't shut down
any servers. :]

Ray at home



Re: script scheduling in AD environment? by Doc

Doc
Mon Oct 20 20:35:46 CDT 2003

And I take it that the bat file, as simple as it would be, I was thinking
more along the lines of a simple AT command could be run as a login.bat file
on each organizational unit in question? Would that work. When you mention
creating the task at the server so that it does not shut down servers, okay,
I get that one, but how would you code in that certain machines (servers or
workstations for that matter) do not shut down. I know that from Active
directory you can right click on a machine, manage it and schedule to your
hearts desire, perhaps even pointing to the vbs shutdown script. Problem is,
you cannot manage a machine in AD if you turned off file and print sharing
on those boxes that dont need it. So if you look in my network places,
entire network, you see nothing but the servers. Figured that turning off
file and print sharing at the workstation level would ease up on traffic and
chattiness.

Darn, and I thought this was going to be easy!

Walt
"Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
news:uSsiMF3lDHA.1488@TK2MSFTNGP12.phx.gbl...
>
> "Doc Wally" <notimeforspam@dot.net> wrote in message
> news:Wf%kb.20247$My3.2119889@news4.srv.hcvlny.cv.net...
>
> >
> > at.exe 21:00 every:m,t,w,th,f,s,su \\servername\sharename\shutdown.vbs
> >
> The issue with this is that the AT service account is the local system
> account of the machine, by default, so it will not have access
(permissions)
> to the share on the server. So, you can either change the AT account to
run
> under a domain account and give that account permissions to access that
.vbs
> file, or you can put this .vbs file on every computer on the network and
> just execute it locally. Both of these options sound like a PITA, though.
>
> If it were me, I'd setup a job to run on a server that would use
> shutdown.exe from the Resource Kit. I'd just do it in a .bat file.
> Something like:
>
> for /f "skip=3" %%j in ('net view') do (shutdown %%j /t:1 /C)
>
> Now, you'd probably want to modify that a bit so that this doesn't shut
down
> any servers. :]
>
> Ray at home
>
>



Re: script scheduling in AD environment? by Ray

Ray
Tue Oct 21 08:13:57 CDT 2003


"Doc Wally" <notimeforspam@dot.net> wrote in message
news:S30lb.21880$My3.2368009@news4.srv.hcvlny.cv.net...
> And I take it that the bat file, as simple as it would be, I was thinking
> more along the lines of a simple AT command could be run as a login.bat
file
> on each organizational unit in question?

If you put this in a login script, the user logging in would need admin
rights to execute the AT scheduling request.

> Would that work. When you mention
> creating the task at the server so that it does not shut down servers,
okay,
> I get that one, but how would you code in that certain machines (servers
or
> workstations for that matter) do not shut down.

There are a few ways. I use gettype.exe from the Resource Kit. That will
get the computer type and set the %errorlevel% variable accordingly.
Returns 1 for Windows NT Workstation.
Returns 2 for Windows 2000 Professional installation.
Returns 3 for Windows NT Server Non-Domain Controller.
Returns 4 for Windows 2000 Server Non-Domain Controller.
Returns 5 for Windows NT Server Domain Controller.
Returns 6 for Windows 2000 Server Domain Controller.
Returns 7 for Windows NT [Enterprise/Terminal] Server Domain Controller
Returns 8 for Windows NT [Enterprise/Terminal] Server Non-Domain Controller

So then you could just execute the shutdown for types 1 and 2.


Or, if your servers have a certain naming convention different from all
workstations, you could do something like this, where all your server names
start out with \\SRV.


for /f "skip=3" %%j in ('net view') do call :ShutIt %%j
:ShutIt
set compName=%1
set pref=%compName:~0,5%
if {%pref%} NEQ {\\SRV} (shutdown %compName% /t:1 /C)





> I know that from Active
> directory you can right click on a machine, manage it and schedule to your
> hearts desire, perhaps even pointing to the vbs shutdown script. Problem
is,
> you cannot manage a machine in AD if you turned off file and print sharing
> on those boxes that dont need it.

Fire the person who made that decision.


> So if you look in my network places,
> entire network, you see nothing but the servers. Figured that turning off
> file and print sharing at the workstation level would ease up on traffic
and
> chattiness.

Yeah, maybe if you're running Novell or something. Fire the person who made
this decision. That was idiotic.


Also, you can AT another computer. You could loop through a net view and
AT-schedule a task on each computer, like, after the server service is back
up and running...

Also remember:
"There are seldom good technological solutions to behavioral problems"
- Ed Crowley


If people are not following guidelines and shutting down their computers,
have their supervisors deal with that. I work at a bank. If the bank
tellers stopped putting their cash in the vault at the end of the day, our
solution would not be to build a robot to go to each teller station, pick up
the cash, and lock it in a safe.

Ray at work







Re: script scheduling in AD environment? by Doc

Doc
Tue Oct 21 22:16:18 CDT 2003

Ray:

Thanks in advance. Yeah, for them to run the AT command in a bat file they
need rights that I do NOT wanto to give them. Now this gettype.exe from the
resource kit, duh, I mean I know how to fire it up, but I am totally
clueless when it comes to actually writing the code itself.

Fortunately, The only types of computers on our entire domain are Windows
2000 advanced servers, domain controllers and non domain controllers. ALL
Workstations are Windows XP Pro boxes. I also know that I could, one by
one, manage them via active directly and set the AT task remotely. Problem
with that is that you need to have file and print sharing turned on in order
to do so and I turned that off because I did not want all the extra chatter
on the network. You mention execute the shutdown for the types (assuming,
arguendo, that the Win2k pro will work) what does that code look like in the
script.

I will owe you my first born for this one and appreciate all the help thus
far given.

Walt
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:Od9jwU9lDHA.2528@TK2MSFTNGP12.phx.gbl...
>
> "Doc Wally" <notimeforspam@dot.net> wrote in message
> news:S30lb.21880$My3.2368009@news4.srv.hcvlny.cv.net...
> > And I take it that the bat file, as simple as it would be, I was
thinking
> > more along the lines of a simple AT command could be run as a login.bat
> file
> > on each organizational unit in question?
>
> If you put this in a login script, the user logging in would need admin
> rights to execute the AT scheduling request.
>
> > Would that work. When you mention
> > creating the task at the server so that it does not shut down servers,
> okay,
> > I get that one, but how would you code in that certain machines (servers
> or
> > workstations for that matter) do not shut down.
>
> There are a few ways. I use gettype.exe from the Resource Kit. That will
> get the computer type and set the %errorlevel% variable accordingly.
> Returns 1 for Windows NT Workstation.
> Returns 2 for Windows 2000 Professional installation.
> Returns 3 for Windows NT Server Non-Domain Controller.
> Returns 4 for Windows 2000 Server Non-Domain Controller.
> Returns 5 for Windows NT Server Domain Controller.
> Returns 6 for Windows 2000 Server Domain Controller.
> Returns 7 for Windows NT [Enterprise/Terminal] Server Domain Controller
> Returns 8 for Windows NT [Enterprise/Terminal] Server Non-Domain
Controller
>
> So then you could just execute the shutdown for types 1 and 2.
>
>
> Or, if your servers have a certain naming convention different from all
> workstations, you could do something like this, where all your server
names
> start out with \\SRV.
>
>
> for /f "skip=3" %%j in ('net view') do call :ShutIt %%j
> :ShutIt
> set compName=%1
> set pref=%compName:~0,5%
> if {%pref%} NEQ {\\SRV} (shutdown %compName% /t:1 /C)
>
>
>
>
>
> > I know that from Active
> > directory you can right click on a machine, manage it and schedule to
your
> > hearts desire, perhaps even pointing to the vbs shutdown script. Problem
> is,
> > you cannot manage a machine in AD if you turned off file and print
sharing
> > on those boxes that dont need it.
>
> Fire the person who made that decision.
>
>
> > So if you look in my network places,
> > entire network, you see nothing but the servers. Figured that turning
off
> > file and print sharing at the workstation level would ease up on traffic
> and
> > chattiness.
>
> Yeah, maybe if you're running Novell or something. Fire the person who
made
> this decision. That was idiotic.
>
>
> Also, you can AT another computer. You could loop through a net view and
> AT-schedule a task on each computer, like, after the server service is
back
> up and running...
>
> Also remember:
> "There are seldom good technological solutions to behavioral problems"
> - Ed Crowley
>
>
> If people are not following guidelines and shutting down their computers,
> have their supervisors deal with that. I work at a bank. If the bank
> tellers stopped putting their cash in the vault at the end of the day, our
> solution would not be to build a robot to go to each teller station, pick
up
> the cash, and lock it in a safe.
>
> Ray at work
>
>
>
>
>
>



Re: script scheduling in AD environment? by Doc

Doc
Tue Oct 21 22:39:56 CDT 2003

Sorry Ray, I did not read all of your message. Been a long day. Okay, the
Vscript code that I know to work is this

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.shutdown()
Next

Obviously if I were to assign this to a logon/startup script the end result
would be a funny joke to play on people.

You provided me with the following code (thanks) wherein it is implied that
skip=3 includes skip a certain machine type. Now, where is the coding for
setting the time for this to execute. That is where I am perplexed. More
important, how the hell do I combine the two (remember, my programming
skills are S H I T newbie, newbie, duhhhbee)
.
> > for /f "skip=3" %%j in ('net view') do call :ShutIt %%j
> > :ShutIt
> > set compName=%1
> > set pref=%compName:~0,5%
> > if {%pref%} NEQ {\\SRV} (shutdown

The person who made the decision is higher up than me and has nothing but a
ten year old computer science degree. This person does not even know how to
use a net send command and even once asked me, with a serious face, if it
was possible to use FTP on a mac.

In terms of our users, its a school, so administration is a lame duck. They
could outlaw something by way of all sorts of policies and nobody would ever
enforce them. The only good thing about this job is that they pretty much
let me do anything they want in terms of new technologies and getting to
play with cool toys - so long as no purported "expert" sticks their hands
where they are not supposed to.



Re: script scheduling in AD environment? by Ray

Ray
Tue Oct 21 22:59:52 CDT 2003


"Doc Wally" <notimeforspam@dot.net> wrote in message
news:g_mlb.30463$6j.4502479@news4.srv.hcvlny.cv.net...
> Sorry Ray, I did not read all of your message. Been a long day. Okay,
the
> Vscript code that I know to work is this
>
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
> strComputer & "\root\cimv2")
> Set colOperatingSystems = objWMIService.ExecQuery _
> ("SELECT * FROM Win32_OperatingSystem")
> For Each objOperatingSystem in colOperatingSystems
> objOperatingSystem.shutdown()
> Next
>
> Obviously if I were to assign this to a logon/startup script the end
result
> would be a funny joke to play on people.

That would be kinda funny. :]

>
> You provided me with the following code (thanks) wherein it is implied
that
> skip=3 includes skip a certain machine type.

The skip=3 indicates that the loop should skip the first three lines
returned from "net view" which are:
Server Name Remark

----------------------------------------------------------------------------
---



> Now, where is the coding for
> setting the time for this to execute. That is where I am perplexed. More
> important, how the hell do I combine the two (remember, my programming
> skills are S H I T newbie, newbie, duhhhbee)

All I'm really doing is adding confusion. This is a vbscript group, and I
keep throwing cmd.exe solutions out. That is not helping!

> .
> > > for /f "skip=3" %%j in ('net view') do call :ShutIt %%j
> > > :ShutIt
> > > set compName=%1
> > > set pref=%compName:~0,5%
> > > if {%pref%} NEQ {\\SRV} (shutdown
>
> The person who made the decision is higher up than me and has nothing but
a
> ten year old computer science degree. This person does not even know how
to
> use a net send command

Wait, do you work where I work? And here's a quote that I'll never forget
from where I work. To make it worse, this is from an "expert" consultant
that we brought in to help us with some NT things. "NET USE doesn't exist
in NT 4." I was in the IT field for about one week working the helpdesk at
that point, and I just about vomited when I heard this "expert" say that.
And I'll take credit for teaching my department about the net send. I
refuse to tell them how to put line breaks in their net sends though. :]

and even once asked me, with a serious face, if it
> was possible to use FTP on a mac.

Okay, I'm dumb. Isn't it?

>
> In terms of our users, its a school, so administration is a lame duck.
They
> could outlaw something by way of all sorts of policies and nobody would
ever
> enforce them. The only good thing about this job is that they pretty much
> let me do anything they want in terms of new technologies and getting to
> play with cool toys - so long as no purported "expert" sticks their hands
> where they are not supposed to.

Will reply more from work tomorrow. Off to bed.

Ray at home



Re: script scheduling in AD environment? by Doc

Doc
Wed Oct 22 12:52:44 CDT 2003

Ray, I am really starting to look forward to your posts. We live in shadows
of the same tree. I try to act as much like a madman as possible so that
they leave me alone. I have yet to master the side to side rapid eye
movement that indicates sheer insanity, but my fake twitches could pass for
real.

> > would be a funny joke to play on people.
>
> That would be kinda funny. :]

Don't even tempt me, please. Oh man, the things we could have fun with.

> Wait, do you work where I work? And here's a quote that I'll never forget
from where I work. To make it worse, this is from an "expert" consultant
that we brought in to help us with some NT things. "NET USE doesn't exist
in NT 4." I was in the IT field for about one week working the helpdesk at
that point, and I just about vomited when I heard this "expert" say that.
And I'll take credit for teaching my department about the net send - refuse
to tell them how to put line breaks in their net sends though. :]
>
You truly are the dark one (evil laugh in background(

> and even once asked me, with a serious face, if it
> > was possible to use FTP on a mac.
>
> Okay, I'm dumb. Isn't it?

No, the FTP Protocol was specifically designed by Bill Gates when he still
wore diapers to only be used by his future vision. Satan appeared to him in
a vision. And neither does FTP work on any platform other than Windows -
yeah, right, thats like saying HTTP only works with Microsoft. If you were
remotely serious (and I doubt that) yes, you can FTP with Mac, Linux, Unix,
and my all time favorite, the Etch-R-Sketch with the NO OS operating system.

> Will reply more from work tomorrow. Off to bed.
>
> Ray at home

Ray, I desperately seek your guidance and wisdom. I cannot tell you how
appreciative I am. It is likely that I will end up diving into scripting,
at least using them from a systems standpoint of view. However, I need a
primer - I have the Windows 2000 Scripting Guide, but I really need to get
to speed on this whole matter so that I don't end up asking stupid questions
and returning favors for beer. Can you recommend any good books/programs
similar to the Sams collection, with regards to scripting of course. I want
to master this stuff if, at the very least, for systems administration as I
see a tremendous amount of power in it.

Now I know why all those scripting guru's drive expensive cars. . .
actually, it was because they were embezzling company funds, I read that
somewhere.

Warmest regards and cold beers on me.

Walt

>
>



Re: script scheduling in AD environment? by Ray

Ray
Wed Oct 22 14:53:14 CDT 2003


"Doc Wally" <notimeforspam@spam.com> wrote in message
news:Mtzlb.41175$6j.7561806@news4.srv.hcvlny.cv.net...
>
> > Will reply more from work tomorrow. Off to bed.
> >
> > Ray at home
>
> Ray, I desperately seek your guidance and wisdom. I cannot tell you how
> appreciative I am. It is likely that I will end up diving into scripting,
> at least using them from a systems standpoint of view. However, I need a
> primer - I have the Windows 2000 Scripting Guide, but I really need to get
> to speed on this whole matter so that I don't end up asking stupid
questions
> and returning favors for beer.


That's my favorite book! Most of the scripting stuff I do is all in ASP.
That's why many of the posts in this group are over my head. But, the WSH
documentation is completely priceless. If you do not have that, download it
at once!
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en



> Can you recommend any good books/programs
> similar to the Sams collection, with regards to scripting of course. I
want
> to master this stuff if, at the very least, for systems administration as
I
> see a tremendous amount of power in it.

!!!! http://www.microsoft.com/technet/scriptcenter/ !!!!

>
> Now I know why all those scripting guru's drive expensive cars. . .

I drive a 1988 Chevy Celebrity station wagon with 180,000 miles on it.

> actually, it was because they were embezzling company funds, I read that
> somewhere.

That's how I got my car!


>
> Warmest regards and cold beers on me.

I'd be more than happy to drink the beers.


Okay, back to the task at hand. Before you'll be able to get any of this
shutdown stuff to work, the machines have to have the server service
running. It sounds like they are not. How can you enable that service if
you cannot access the machines remotely? There aren't too many options.
The simplest option is to use sc.exe from the Resource Kit or just merge a
.reg file in a logon script. The problem with this though is that for this
to work, the person logging on needs administrative rights. Unless you have
other domain groups added to the local admin groups on the machines, the
only way you can do this is to add your users to the domain admin groups.
I've had to do that before. But, what you can do for safety's sake is
something like this, in a .bat file in netlogon:



regedit /s %logonserver%\startserver.reg
%logonserver%\shutdown /c /r /t:1



You'd want to put shutdown.exe in your netlogon share for this to work. And
the contents of startserver.reg would look like this (2000+)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver]
"Start"=dword:00000002



What this logon script will do is silently merge that registry data and
update the startup type to 2, which is automatic. It will then execute
shutdown.exe and force a reboot after 1 second. (The default is 30. If you
leave it at that, a crafty user can use shutdown.exe to abort his own
shutdown and continue on the rest of the day with domain admin rights.)

You won't be able to do anything on those machines without the server
service running. Fire the person who stopped the service. :]

Ray at work





Re: script scheduling in AD environment? by Doc

Doc
Thu Oct 23 15:45:14 CDT 2003

Hey Ray:

Benn a freakin nutty ass couple of days here as I try to figure some stuff
out.

I found a nifty little utility called schtasks. Now, work with me on
this one and if you heard of it, tell me to f-- off.

The link to this nifty thing is
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/winxppro/proddocs/schtasks.asp



Right, this thing will apparently allow me to remotely execute a vb script
version of the AT command, or something that does essentially what I want it
to do, now, the script that I pulled out of the script resource kit was (and
I refer to it because you may be having the same type of day that I have
had - e.g. brainfart):



strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.shutdown()
Next



This thing will shut down the computer when you run it, unless, of course,
something pesky like outlook.exe is running, but I believe that the schtasks
utility gives you the ability to kill an application.



Now, assuming (arguendo of course) that there are no other such applications
that require your exit thereof before shutting down a machine (e.g. that the
freakin user actually has to shut down the applications - and of course
there WILL be one, just have to figure out if its a legit application or
some third party piece of shit, ten year-old, DOS wanna be GUI program thats
doing it), okay, so then we have an at 2100 hours command that says log off,
exit programs, shut your muther fucking third ass party app shit down
moe-foe, and then at, lets say 21:25 hours another one saying hey, see that
script in that thar shared folder on that thar server? Well run it then, it
should, in effect and theory shut the bloody ass wipes down.



It works fine in theory, in practice its a totally different story
altogether. The way I see this utility, its nothing more than a remote way
of running the AT command - now this is really driving me up a freakin wall.
I mean, to encapsulate it, then have a bunch of windows xp machines call to
that bat file or whatever.vbs file,. . . oh man, I am in a loop, literally.
At this windows xp box I simply typed the following in a notepad file and
then turned it into a .bat and even a .exe file, supposedly, its supposed to
delete all tasks from the local computer.



schtasks / delete /tn * /f



Only thing the darn thing did it loop, literally as a .bat file and as an
.exe file it just hung there. No, I have to look at the bloody event log to
see if I really need check up on permissions switches and shit.



Okay, I have been trying to fire this one out to you for about an hour now
while trying to figure this thing out. I know that I am so close, so
freakin close and that there has to be a simpler way of doing this than
writing up oodles of code. Ultimately, its simple and, well, here is a dumb
ass question



Using the AT command, what is its syntax to run something only once with
admin privileges. My brain is totally, totally, totally fried and all I
know is that I cannot have these monkeys having any sorts of permissions
whatsoever. Dude, there are people here with full admin permissions who
dont know the difference between a netbios name and a cookie. CDW has a
"dear fred" book series, which I suggest you ask your CDW rep, if not, send
me contact info somehow and I will get same to you quickly, its a
compilation of stories, half of which I could have written. Hopefully, the
next time its released it will have several of my little stories in there.



In your debt,



Walt.



P.S. I downloaded and visited all the sites you spoke of, no sweat had been
to many of them there and have all the necessary resources. Now if all it
takes is learning visual basic. . .




It looks like it may just be what the doctor ordered. Of course, there are
issues, such as outlook being open and then
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eqiTiYNmDHA.2068@TK2MSFTNGP09.phx.gbl...
>
> "Doc Wally" <notimeforspam@spam.com> wrote in message
> news:Mtzlb.41175$6j.7561806@news4.srv.hcvlny.cv.net...
> >
> > > Will reply more from work tomorrow. Off to bed.
> > >
> > > Ray at home
> >
> > Ray, I desperately seek your guidance and wisdom. I cannot tell you how
> > appreciative I am. It is likely that I will end up diving into
scripting,
> > at least using them from a systems standpoint of view. However, I need
a
> > primer - I have the Windows 2000 Scripting Guide, but I really need to
get
> > to speed on this whole matter so that I don't end up asking stupid
> questions
> > and returning favors for beer.
>
>
> That's my favorite book! Most of the scripting stuff I do is all in ASP.
> That's why many of the posts in this group are over my head. But, the WSH
> documentation is completely priceless. If you do not have that, download
it
> at once!
>
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en
>
>
>
> > Can you recommend any good books/programs
> > similar to the Sams collection, with regards to scripting of course. I
> want
> > to master this stuff if, at the very least, for systems administration
as
> I
> > see a tremendous amount of power in it.
>
> !!!! http://www.microsoft.com/technet/scriptcenter/ !!!!
>
> >
> > Now I know why all those scripting guru's drive expensive cars. . .
>
> I drive a 1988 Chevy Celebrity station wagon with 180,000 miles on it.
>
> > actually, it was because they were embezzling company funds, I read that
> > somewhere.
>
> That's how I got my car!
>
>
> >
> > Warmest regards and cold beers on me.
>
> I'd be more than happy to drink the beers.
>
>
> Okay, back to the task at hand. Before you'll be able to get any of this
> shutdown stuff to work, the machines have to have the server service
> running. It sounds like they are not. How can you enable that service if
> you cannot access the machines remotely? There aren't too many options.
> The simplest option is to use sc.exe from the Resource Kit or just merge a
> .reg file in a logon script. The problem with this though is that for
this
> to work, the person logging on needs administrative rights. Unless you
have
> other domain groups added to the local admin groups on the machines, the
> only way you can do this is to add your users to the domain admin groups.
> I've had to do that before. But, what you can do for safety's sake is
> something like this, in a .bat file in netlogon:
>
>
>
> regedit /s %logonserver%\startserver.reg
> %logonserver%\shutdown /c /r /t:1
>
>
>
> You'd want to put shutdown.exe in your netlogon share for this to work.
And
> the contents of startserver.reg would look like this (2000+)
>
> Windows Registry Editor Version 5.00
>
> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver]
> "Start"=dword:00000002
>
>
>
> What this logon script will do is silently merge that registry data and
> update the startup type to 2, which is automatic. It will then execute
> shutdown.exe and force a reboot after 1 second. (The default is 30. If
you
> leave it at that, a crafty user can use shutdown.exe to abort his own
> shutdown and continue on the rest of the day with domain admin rights.)
>
> You won't be able to do anything on those machines without the server
> service running. Fire the person who stopped the service. :]
>
> Ray at work
>
>
>
>