Изменить атрибуты компьютера в active directory

Изменить свойства компьютера с помощью консоли Active Directory (ADUC)

Администратор может изменить атрибуты компьютер в Active Directory с помощью графической консоли ADUC.

Изменить свойства компьютера в Active Directory

Вы можете отредактировать значения остальных атрибутов компьютера на вкладке Attribute Editor. Будьте внимательными при редактировании обязательных атрибутов компьютера. Редактор атрибутов объекта в AD не проверяет корректность введенных данных (проверяется только тип данных и длина значения), поэтому при некорректных значения атрибутов компьютера, он может потерять доверительные отношения с доменом.

Редактор атрибутов компьютера в AD

Изменить значение атрибута компьютера в AD с помощью PowerShell

Командлет Set-ADComputer (из модуля Active Directory для PowerShell) позволяет изменить атрибуты учетной записи компьютера в Active Directory.

Например, вы хотите добавить в свойства компьютера в AD его, название компании и департамента, которому он принадлежит.

Чтобы изменить значение основных атрибутов компьютера, можно использовать встроенные параметры, таки как
-Description
,
-DisplayName
,
-DNSHostName
,
-HomePage
,
-Location
и т.д., Например указать местоположение компьютера:

Set-ADComputer –Identity SRV-MAN01 –Location "Spb/Russia"

Также можно изменить значение любого атрибута с помощью параметров
Add
,
Replace
,
Clear
и
Remove
.

Задать новое описание учетной записи компьютера:

Если нужно задать несколько параметров компьютера, воспользуйтесь такой конструкцией PowerShell:

$Server = Get-ADComputer -Identity SRV-MAN01
$Server.company = "contoso"
$Server.department = "IT"
Set-ADComputer -Instance $Server

С помощью Get-ADComputer можно получить текущие значения атрибутов:

Set-ADComputer командлет PowerShell

С помощью Set-ADComputer вы также можете отключить или включить учетную запись компьютера в AD:

Set-ADComputer srv-man01 -Enabled $false

Как добавить имя пользователя и IP адрес в свойства компьютера в AD?

IP адрес компьютера мы будем хранить в атрибуте description, а имя пользователя, который работает за компьютером – в атрибуте ManagedBy.

делегирование прав Write Description + Write Managed By в AD на компьютеры

Данный PowerShell скрипт будет запускаться при входе пользователя, определять имя и IP адрес компьютера, CN пользователя и сохранит их в свойства компьютера в AD. Для работы скрипта на компьютерах должен быть установлен модуль AD PowerShell.

:/>  «Используйте функцию командной строки Windows 10 для администрирования учетных записей пользователей и освойте технику добавления или удаления учетных записей пользователей с помощью командной строки Windows»

В консоли ADUC теперь отображаются IP адреса компьютеров, а в свойствах компьютера на вкладке Managed By теперь есть активная ссылка на учетную запись пользователя, который последним входил на компьютер.

имя пользователя в свойствах компьютера ad

Теперь вы можете быстро найти компьютеры в домене по IP адресу:

поиск компьютеров в ad по имени пользователя

Аналогичным образом вы можете записать в свойства аккаунтов компьютеров в AD любую информацию о рабочей станции или пользователе, и использовать ее для поиска (выборки) компьютеров в AD. В статье по ссылке описано как записать в описание компьютера в AD информацию о модели, серийном номере оборудования.

In this post, I’ll show you several examples of the Get-ADComputer PowerShell command. This command is used to search active directory to get single or all computer accounts. I’ll also show you how to use the Get-ADComputer filter option to limit results based on specific computer properties (for example, the name, OU, and modified date).

Let’s get started.

Get-ADComputer Examples

1. Get All AD Computers

get-adcomputer -filter *

This command will get a list of all computers in the domain.

get all computer accounts

2. Get All Computers with all properties

get-adcomputer -filter * -properties *

This command will get all computers and all of the computer properties (attributes). By default, the get-adcomputer command only displays 8 properties. You must use the -properties * command to list them all.

get all computers and all properties

3. Get All Computers from an OU

Get-ADComputer -Filter * -SearchBase "OU=ADPRO Computers,DC=ad,DC=activedirectorypro,DC=com" 

This command will get all computers from a specific OU by using the -SearchBase parameter and the distinguishedName of the OU.

get all computers from ou

4. Get All Computers and Show Specific Properties

Get-ADComputer -Filter * | select name, Enabled

This command will get all computers and limit the output to display the name and enabled properties only.

:/>  Какая у меня разрядная система
get all computers status

5. Get All Enabled Computers

Get-ADComputer -Filter "Enabled -eq 'True'"

This command uses the -filter option to limit the results to only enabled computers.

get all enabled computers
Get-ADComputer -Filter "Enabled -eq 'True'" | select Name, Enabled

6. Get All Disabled Computers

Get-ADComputer -Filter "Enabled -eq 'false'" | select Name, Enabled

This command filters for enabled computers and limits the output to the name and enabled properties.

get all disabled computers

7. Get All Computers with a specific Name (Wildcard Search)

Get-ADComputer -Filter "Name -like 'SRV*'" | select Name, Enabled

This command searches for computers that start with srv in the name field.

filter computers by name

8. Get All Computers and IP Addresses

Get-ADComputer -Filter * -properties * | select Name, Enabled,ipv4address

This command gets all computers and displays the IP address of each computer.

get all computers and ip address

9. Get All Computers lastlogondate

Get-ADComputer -Filter * -properties * | select name,lastlogondate

This command gets all domain computers and displays the lastlogondate value.

get all computers lastlogondate

10. Get All Computers Last Modified Date from an OU

Get-ADComputer -Filter * -SearchBase "OU=ADPRO Computers,DC=ad,DC=activedirectorypro,DC=com" -properties *| select name, whenchanged

This command will get all computers from a specific OU and display the computer’s last modified date (whenchanged attribute).

all computers from an ou and modified date

Built-in Active Directory Computer Reports

Изменить атрибуты компьютера в active directory

Download a Free Trial of the AD Pro Toolkit.