我如何實現這個效果呢?(黃色標記部分)
1、開啟高級功能
2、選擇 Computer,屬性
3、安全,Authenticated User,高級
4、Authenticted Users,編輯
5、選擇,應用於後代計算機對象
6、寫入描述,確定,確定,確定
7,新建(組織單位,名字隨你);連接現有GPO(選擇,Default Policy);
用戶配置,Windows設置,(腳本)登陸/註銷
選擇(登陸),添加…瀏覽
8、新建文本(名字隨意),改擴展名為VBS(TXT To VBS),並選擇
9、重點 VBS的腳本,將內容複製到VBS裡面
'On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
If left(objComputer.description,1) = "`" Then
'If a tilda exists the script will terminate. This allows custom
' descriptions that dont get overwritten.
Wscript.Quit
Else
'Sets variables for Computer name, Manufacturer, Model,
' and Serial number
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colComputerSystem = objWMIService.ExecQuery ("Select * from Win32_computersystem")
Set colBIOS = objWMIService.ExecQuery ("Select * from Win32_BIOS")
For each objComputerSystem in colComputerSystem
GetComputerManufacturer = objComputerSystem.Manufacturer
GetComputerModel = objComputerSystem.Model
Next
For each objBIOS in colBIOS
GetSerialNumber = objBIOS.SerialNumber
Next
'String cleaning - Manufacturer includes only first word, and
' the serial removes any spaces.
txtCount = InStr(GetComputerManufacturer," ") - 1
GetComputerManufacturer = Left(GetComputerManufacturer,txtCount)
GetSerialNumber = Replace(GetSerialNumber, " ", "")
'Below are two variants in building the final string. Please chose which
' you prefer. I did read but could not validate that excessive computer description
' changes can cause AD change limits to be reached.
'First one is without dates and second is with dates. Below ar examples. The
' string is also trimmed to 1024 characters as per AD schema req (just in case)
'### DESCRIPTION WITH DATE ###
'Example:
'John Doe (jdoe) - Dell Optiplex 990 - DRP421S
strDate = Now & " | "
strCompDesc = strDate & objUser.SAMAccountName & " | " & objUser.CN & " | " & GetComputerManufacturer & " " & GetComputerModel & " | " & GetSerialNumber
strCompDesc = Left(strCompDesc,1024)
'Compares AD string and generated string and skips if they are
' identical. This saves AD change count.
If strCompDesc = objComputer.description Then
wscript.Quit
Else
objComputer.Description = strCompDesc
objComputer.SetInfo
End If
End If
10、應用,確認。
11、服務器上,強制性刷新組策略(gpupdate /force)
12、登陸你的計算機,做測試
13、Done,假設這個腳本,是需要哪個用戶登陸了那部機子,以便更好的管理。
腳本的管理與建設都可以多樣化,這個就隨你啦,謝謝大家。