简体   繁体   中英

how to Elevating Privileges for Chkdsk in a mass batchfile/Powershell script in a GPO

our SCCM was broken by an update. so broke we made a new one. according to sysadmin we will have to run some windows commands to get it running. two of the steps require running at elevated privilege. Instead of having help desk go through each PC manually it would be super nice if I could build a batch file or powershell script to do all this under a GPO.

As far as i have been able to tell there is no easy way to automate the elevated privilege portion of the steps

some pseudocode

  1. run sysadmins "fix sccm" powershell script
  2. run at an elevated Prompt : CHKDSK /F
  3. Reboot
  4. Open an elevated CMD and run the following command: fsutil resource setautoreset true C:\\
  5. Reboot
  6. Install the SCCM Agent

all the options i have run so far, powershell script, run from shortcut, run in plain cmd, etc is that all require a button push or yes clicked.

we need it to run and restart without any user interaction. this will save us thousands of man hours.

thank you very much for your help

向其编写批处理文件/脚本创建快捷方式,右键单击快捷方式上的属性,然后单击以管理员身份运行的高级,然后以GPO的身份应用该运行,这将绕过管理员问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM