Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Policy Preferences Problem - Services

Status
Not open for further replies.

AndyE45

MIS
Jul 24, 2003
183
CA
Target machines: Windows 2003 std, Windows XP sp3

Client side extensions installed.

I have a prefs policy that should set the password for the local account that runs a service. The same policy also sets the password on the local account.

I followed the tips in the help file and the app logs show the policy applied without errors.

Setting the password on the account works great but setting the password on the service doesn't work at all.

Has anybody tried this?
 
Sorry I have not. You might want to try SUBINACL instead.


I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Mark,

I don't see how this util will help with changing the password on the service.
 
Sorry my bad. SUBINACL will let you change permissions on the service but not set the user ID & Password.

You can do this via script. Here is the code that will do it. Just change the parts in [red]red[/red].

Code:
strComputer = "[red].[/red]"
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colServiceList = objWMIService.ExecQuery _
    ("Select * from Win32_Service Where StartName = '.\[red]netsvc[/red]'")

For Each objService in colServiceList
    errReturn = objService.Change( , , , , , , , "[red]password[/red]")  
Next

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Thanks Mark, I may have to use this if I can't get GP Prefs working.
 
Update:

I posted this issue in an MS forum and an MS tech who monitors it was able to reproduce the issue and has reported it. Hopefully they'll be able to fix it, this would be a very valuable tool to have.
 
Mark,

UPDATE

Thanks again for your input on this and my other post regarding GP Prefs.

I tried your script and unfortunately it came up with an error so I did a little poking around and developed a batch file that does the job:

rem Reset the user USERNAME's password to NEWPASSWORD
net user USERNAME NEWPASSWORD

rem set the password on the service where the account is used
sc \\%computername% config "SERVICENAME" obj= .\USERNAME password= NEWPASSWORD

P.S. You only need quotes around SERVICENAME if there's a space in its name, be sure you get the service name, not the display name which is often different.
 
What error did you get? Did you use the service name and not the service display name?

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
I don't remember the error number but seem to remember it was on line 8.

If you noticed the P.S. in my last post, I know about using the service name as opposed to the display name. Or are you saying I should have used the display name? It wouldn't have mattered in my case since they were the same.
 
Hmm something is fishy. That code should be fine, it is direct from the Microsoft script repository.

Line 8 or there abouts is related to selecting the service. So for whatever reason it had a problem with binding to the service name.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top