当前位置:网站首页>User identity used by startup script and login script in group policy
User identity used by startup script and login script in group policy
2022-07-03 18:40:00 【51CTO】
In Group Policy , We can use startup / To turn it off , Sign in / Log off these actions as events for executing scripts .

start-up / The shutdown script is under the computer configuration menu , Sign in / The logout script is under the user configuration menu . seeing the name of a thing one thinks of its function , Computer configuration is global , The authority must be relatively high . User configuration is specific to the user environment , Permission must be limited .
Let's see when running through an experiment Group Policy - Computer configuration - The startup script , as well as Group Policy - User configuration - Login script When , Specifically, what user identity is used to run .
First ,windows In the environment variable ,%username% Is the current user name ,%userprofile% Is the current user configuration path ,%homepath% Is the path of the current user's home directory ,%appdata% Is the current user data folder .whoami /user In addition to displaying the user name, the command can also display SID.
Write a script that contains the following :
whoami /user >>x:\test.txt
echo %username%,%userprofile%,%homepath%,%appdata%>>x:\test.txt
Pay attention to save the path. We give it everyone read-write permission .
Then make the startup script and login script respectively .
The computer operating system of the testing machine is win10, The name is test, Use users The account name of the permission is ceshi.
The final verification is as follows :
Boot script
whoami The display uses nt authority\system account number ,sid yes S-1-5-18
%username% yes TEST$ ,—— Add $ Symbol
%userprofile% yes C:\Windows\system32\config\systemprofile
%homepath% Display blank
%appdata% Is shown as C:\Windows\system32\config\systemprofile\AppData\Roaming
Login script
whoami The display uses domain name \ceshi,sid Namely S-1-5-21-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXX-XXXX
%username% yes ceshi
%userprofile% yes C:\Users\ceshi
%homepath% yes \Users\ceshi
%appdata% yes C:\Users\ceshi\AppData\Roaming
obviously , The identity used by the boot script is system user , Have more than administrators Authority
The login script uses the identity and permissions of the current login user . Therefore, some login scripts that must be run by the administrator cannot be used .
边栏推荐
- 204. Count prime
- Ping problem between virtual machine and development board
- TypeScript 官网教程
- 变化是永恒的主题
- [combinatorics] generating function (positive integer splitting | unordered non repeated splitting example)
- [combinatorics] generating function (example of generating function | calculating generating function with given general term formula | calculating general term formula with given generating function)
- Shell script return value with which output
- Briefly describe the quantitative analysis system of services
- How to disable the clear button of ie10 insert text box- How can I disable the clear button that IE10 inserts into textboxes?
- Compose LazyColumn 顶部添加控件
猜你喜欢

Prototype inheritance..
![[enumeration] annoying frogs always step on my rice fields: (who is the most hateful? (POJ hundred practice 2812)](/img/50/f89092b492d0138304209a72ff05b4.jpg)
[enumeration] annoying frogs always step on my rice fields: (who is the most hateful? (POJ hundred practice 2812)

Computer graduation project PHP library book borrowing management system

论文阅读 GloDyNE Global Topology Preserving Dynamic Network Embedding

2022-2028 global physiotherapy clinic industry research and trend analysis report

An academic paper sharing and approval system based on PHP for computer graduation design

FBI warning: some people use AI to disguise themselves as others for remote interview

2022-2028 global petroleum pipe joint industry research and trend analysis report

Win 11 major updates, new features love love.
![How to read the source code [debug and observe the source code]](/img/87/3cb25eb0301dc8046e39b997411e59.jpg)
How to read the source code [debug and observe the source code]
随机推荐
2022-2028 global solid phase extraction column industry research and trend analysis report
What kind of experience is it when the Institute earns 20000 yuan a month?
Read the paper glodyne global topology preserving dynamic network embedding
Xception for deeplab v3+ (including super detailed code comments and original drawing of the paper)
Introduction to SSH Remote execution command
Torch learning notes (5) -- autograd
Use of unsafe class
编程中常见的 Foo 是什么意思?
How to analyze the rising and falling rules of London gold trend chart
Have you learned the correct expression posture of programmers on Valentine's day?
Unity webgl optimization
Computer graduation design PHP sports goods online sales system website
2022-2028 global copper foil (thickness 12 μ M) industry research and trend analysis report
Typescript configuration
After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people
Common PostgreSQL commands
Raft 日志复制
[leetcode周赛]第300场——6110. 网格图中递增路径的数目-较难
[Yu Yue education] world reference materials of Microbiology in Shanghai Jiaotong University
MySQL duplicate check