C
C
Cyril2015-10-09 14:28:22
Active Directory
Cyril, 2015-10-09 14:28:22

How to copy attribute value in ActiveDirectory?

In ActiveDirectory, you need to change the value of the User attribute to the value of the Computer attribute . For clarity of what I want:
- all AD users have some attribute someUserAttribute ;
- the value of this attribute must be assigned to the someComputerAttribute attribute of the computer on which the user is logged in.
As a result, both the user and the computer have equal values ​​for the someUserAttribute and someComputerAttribute attributes.
How to implement this (probably in PowerShell) so that the specified actions occur when the user is authorized by the domain controller?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2015-10-15
@belyaevcyrill

We simplify the life of the administrator, associate the name with the floor ...
only in the script change what to register and get someUserAttribute

On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("WScript.Network")
Set objUser = GetObject("LDAP://" & objNetwork.ComputerName)
objUser.Put "someComputerAttribute", objSysInfo.UserName
objUser.SetInfo

And do not forget to give write permissions to this attribute!
There is a similar article.
Logged in users on the PC in the Active D console...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question