powershell - 在批处理文件中以另一个 Windows 用户身份运行单个命令
问题描述
我有以下批处理文件(在 Jenkins 中)。我只想以另一个 Windows 用户身份运行“SqlPackage.exe”命令。我有它的域用户 ID 和密码。
批处理文件:
CD Folder_Name
DEL Another_Folder
SqlPackage.exe /Action:Script /sf:DB.dacpac /Profile:publish.xml /TargetServerName:Server1 /op:Publish.sql
Copy Publish.sql Somewhere_Folder
我知道我可以使用 Windowsrunas
功能以其他用户身份运行批处理文件。但是,在这种情况下,我只想运行单个命令(sqlpackage.exe)。
可能吗?
解决方案
推荐阅读
- reactjs - How to get queryset in django rest framework for foreignkey?
- javascript - Facebook Login 不断重复询问权限 React Native?
- oracle - Not able to make new oracle db connection in sqldeveloper
- javascript - How do I create an express route that handles an HTTP GET request which sends an a href tag
- spring-boot - Vaadin BeanCreationException: during trying to call save method of my service class
- javascript - 如何制作和不和谐自动删除角色的 js 事件?
- php - 在 Laravel 6.2 中从空值创建默认对象
- android - 如何使用 Cloud Functions (Typescript) 在 Firebase 实时数据库中的 .ref(/path) 之外创建新的父节点?
- wordpress - How to show custom taxonomy in tab not working when using with wp post query?
- graph - 有趣的 Python 数据结构问题,涉及不相交集、散列和图