/build/static/layout/Breadcrumb_cap_w.png

Powershell Script help!

Hi,

Can anyone help out with a powershell script to perform 4 functions which are
1-enable powershell script to run on a remote machine
2-stop a service at logon in system context
3-change a registry entry
and
4-restart the same service.

I need to make sure a particulat service is stopped before changing the registry value then once the reg value is changed , to restart the same service.

Powershell is disabled by default on all machine in the environment
Thanks

0 Comments   [ + ] Show comments

Answers (8)

Posted by: anonymous_9363 13 years ago
Red Belt
2
Seriously? You're asking the same question but in respect of a different scripting language? Do you REALLY want another post with LMGTFY links in it? Holy cow...you simply cannot be that lazy.

And BTW, *NO* script should *EVER* be just a three-liner because, if it is, it means [puts on drum to bang, starts blowing same old trumpet] that there's zero error-trapping. As such, it will work 99.99% of the time but you can guarantee that the 0.01% of the time when it fails, it will be at a time of maximum inconvenience to you and maximum exposure of you.
Posted by: dunnpy 13 years ago
Red Belt
2
Ola,

The people in this forum want to help people with their issues and questions, but you really are not going to get help if you don't do the ground work yourself.

Ian (VBscab) is of great help to people here - look at his number of postings and score, they speak for themselves.

Your topic started as a powershell question, the answer to which you could have found out yourself with Google. Then you changed your mind and requested the same thing for VB script - again, you could Google the answer.

If you had done your homework and got the bones of a script that wasn't quite working right you would get all the help in the world with people offering modifications and different methods of acheiving the same goal.

Instead, the way you have come across is 'Can someone do my job for me?' - Can you see how it can be perceived as that?

Ian's not doing this to be nasty - he's prompting you to be technically better by challenging you to do some investigation, learn from what you find out there and come back with questions you really can't find the answer to.

Hope that clarifies things,

Dunnpy
Posted by: noodles187 13 years ago
Orange Belt
0
Hi, thanks for the response, how can i get to deploy this script using SCCM, will it be easier to convert it to vbscript (how can i) as i believe that for the powershell script to run on XP machines, the powershell engine must be installed on the remote machines. Thanks
Posted by: dunnpy 13 years ago
Red Belt
0
Ola,

You would need to install the engine on the client machines, but with SCCM you shouldn't have any problems doing that.

You can deploy it either by utilising the patch management features of SCCM or through WSUS.

http://support.microsoft.com/kb/926139

Thanks,

Dunnpy
Posted by: noodles187 13 years ago
Orange Belt
0
Hi Paul,

Thanks for the response but i don't intend installing powershell to the clients. I want to know how to convert the powershell script into a vbs file (as i'm more comfortable scripting in PS) then use the "cscript.vbs" command line in the sccm program to deploy the script to the clients.

Or rather, can someone give me examples of a vbscript to do the following
1-stop a service at logon in system context (on remote machines)
2-change a registry entry to point to a unc path (\\server1\directory1\file1)
and
3-restart the same service once the file's been updated.

I know this is just a three liner in PS, but as PS won't execute on machines without the engine, it'll be much easier to do it via vbs.

Thanks
Posted by: noodles187 13 years ago
Orange Belt
0
Hi VBscab,

Thanks for the response and i'm sure you know this is a public forum where anyone can ask questions regardless of how easy the results are. Some people know these things but just dont know how to put it together so stop being a DH , you don't have to respond to posts that you feel are too simple.
Posted by: noodles187 13 years ago
Orange Belt
0
Thanks Paul
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ