发布于 2021-06-09 19:31:06
您只需使用UserName来检索他们的SID,以便在wevtutil命令中使用。
从命令提示符,(/问题/标记/cmd)
For /F %G In ('%SystemRoot%\System32\wbem\WMIC.exe UserAccount Where "Name='KnownUserName'" Get SID 2^>NUL ^| %SystemRoot%\System32\find.exe "-"') Do @%SystemRoot\System32\wevtutil.exe CommandLineOptions您只需替换KnownUserName和CommandLineOptions,并将它们的SID替换为%G。
或者来自批文件
@For /F %%G In ('%SystemRoot%\System32\wbem\WMIC.exe UserAccount Where
"Name='KnownUserName'" Get SID 2^>NUL ^| %SystemRoot%\System32\find.exe "-"'
) Do @%SystemRoot\System32\wevtutil.exe CommandLineOptions显然,您将再次替换KnownUserName和CommandLineOptions,这次用%%G替换它们的SID。
https://stackoverflow.com/questions/67889329
复制相似问题