用于更改服务帐户的 Powershell 脚本 [英] Powershell script to change service account
本文介绍了用于更改服务帐户的 Powershell 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有人有一个 Powershell 脚本来更改 Windows 服务使用的凭据?
Does anyone have a Powershell script to change the credentials used by a Windows service?
推荐答案
稍微简单一点 - 使用 WMI.
Bit easier - use WMI.
$service = gwmi win32_service -computer [computername] -filter "name='whatever'"
$service.change($null,$null,$null,$null,$null,$null,$null,"P@ssw0rd")
在过滤器中适当更改服务名称;适当设置远程计算机名称.
Change the service name appropriately in the filter; set the remote computer name appropriately.
这篇关于用于更改服务帐户的 Powershell 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文